Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add: new `panderOptions` for table caption prefix

  • Loading branch information...
commit 0eb5e9af9ce8744c937caeef3060596b99cf3179 1 parent 351b6f0
@daroczig daroczig authored
View
2  R/helpers.R
@@ -880,7 +880,7 @@ pandoc.table.return <- function(t, caption = storage$caption, digits = panderOpt
## (optional) caption
if (!is.null(caption))
if (caption != '')
- res <- sprintf('%sTable: %s\n\n', res, caption)
+ res <- paste0(res, panderOptions('table.caption.prefix'), caption, '\n\n')
## truncating caption buffer if needed
if (!is.null(storage$caption))
View
2  R/options.R
@@ -12,6 +12,7 @@
'table.style' = 'multiline',
'table.split.table' = 80,
'table.split.cells' = 30,
+ 'table.caption.prefix' = 'Table: ',
'table.continues' = 'Table continues below',
'table.continues.affix' = '(continued below)',
'evals.messages' = TRUE,
@@ -188,6 +189,7 @@ masked.plots$plot <- masked.plots$barplot <- masked.plots$lines <- masked.plots$
#' \item \code{table.style}: \code{'multiline'}, \code{'grid'}, \code{'simple'} or \code{'rmarkdown'} passed to \code{\link{pandoc.table}}
#' \item \code{table.split.table}: numeric passed to \code{\link{pandoc.table}} and also affects \code{pander} methods. This option tells \code{pander} where to split too wide tables. The default value (\code{80}) suggests the conventional number of characters used in a line, feel free to change (e.g. to \code{Inf} to disable this feature) if you are not using a VT100 terminal any more :)
#' \item \code{table.split.cells}: numeric (default: \code{30}) passed to \code{\link{pandoc.table}} and also affects \code{pander} methods. This option tells \code{pander} where to split too wide cells with line breaks. Set \code{Inf} to disable.
+#' \item \code{table.caption.prefix}: string (default: \code{'Table: '}) passed to \code{\link{pandoc.table}} to be used as caption prefix. Be sure about what you are doing if changing to other than \code{'Table: '} or \code{':'}.
#' \item \code{table.continues}: string (default: \code{'Table continues below'}) passed to \code{\link{pandoc.table}} to be used as caption for long (split) without a use defined caption
#' \item \code{table.continues.affix}: string (default: \code{'(continued below)'}) passed to \code{\link{pandoc.table}} to be used as an affix concatenated to the user defined caption for long (split) tables
#' \item \code{evals.messages}: boolean (default: \code{TRUE}) passed to \code{evals}' \code{pander} method specifying if messages should be rendered
View
5 README.md
@@ -324,7 +324,7 @@ The output of different **statistical methods** are tried to be prettyfied. Some
---------------------------------------------------
Test statistic P value Alternative hypothesis
---------------- --------- ------------------------
- 0.12 _0.8693_ two-sided
+ 0.24 _0.1124_ two-sided
---------------------------------------------------
Table: Two-sample Kolmogorov-Smirnov test: `runif(50)` and `runif(50)`
@@ -656,6 +656,7 @@ myReport$export(open = FALSE)
* `table.style`: `'multiline'`, `'grid'` or `'simple'` passed to `pandoc.table`
* `table.split.table`: numeric passed to `pandoc.table` and also affects `pander` methods. This option tells `pander` where to split too wide tables. The default value (`80`) suggests the conventional number of characters used in a line, feel free to change (e.g. to `Inf` to disable this feature) if you are not using a VT100 terminal any more :)
* `table.split.cells`: numeric (default: `30`) passed to `pandoc.table` and also affects `pander` methods. This option tells `pander` where to split too wide cells with line breaks. Set `Inf` to disable.
+ * `table.caption.prefix`: string (default: `Table: `) passed to `pandoc.table` to be used as caption prefix. Be sure about what you are doing if changing to other than `Table: ` or `:`.
* `table.continues`: string (default: `Table continues below`) passed to `pandoc.table` to be used as caption for long (split) without a use defined caption
* `table.continues.affix`: string (default: `(continued below)`) passed to `pandoc.table` to be used as an affix concatenated to the user defined caption for long (split) tables
* `evals.messages`: boolean (default: `TRUE`) passed to `evals`' `pander` method specifying if messages should be rendered
@@ -821,4 +822,4 @@ To use this small lib, just type: `M-x pander-mode` on any document. It might be
-------
-This report was generated with [R](http://www.r-project.org/) (2.15.3) and [pander](https://github.com/rapporter/pander) (0.3.3) in 1.051 sec on x86_64-unknown-linux-gnu platform.
+This report was generated with [R](http://www.r-project.org/) (2.15.3) and [pander](https://github.com/rapporter/pander) (0.3.3) in 1.534 sec on x86_64-unknown-linux-gnu platform.
View
1  inst/README.brew
@@ -384,6 +384,7 @@ myReport$export(open = FALSE)
* `table.style`: `'multiline'`, `'grid'` or `'simple'` passed to `pandoc.table`
* `table.split.table`: numeric passed to `pandoc.table` and also affects `pander` methods. This option tells `pander` where to split too wide tables. The default value (`80`) suggests the conventional number of characters used in a line, feel free to change (e.g. to `Inf` to disable this feature) if you are not using a VT100 terminal any more :)
* `table.split.cells`: numeric (default: `30`) passed to `pandoc.table` and also affects `pander` methods. This option tells `pander` where to split too wide cells with line breaks. Set `Inf` to disable.
+ * `table.caption.prefix`: string (default: `Table: `) passed to `pandoc.table` to be used as caption prefix. Be sure about what you are doing if changing to other than `Table: ` or `:`.
* `table.continues`: string (default: `Table continues below`) passed to `pandoc.table` to be used as caption for long (split) without a use defined caption
* `table.continues.affix`: string (default: `(continued below)`) passed to `pandoc.table` to be used as an affix concatenated to the user defined caption for long (split) tables
* `evals.messages`: boolean (default: `TRUE`) passed to `evals`' `pander` method specifying if messages should be rendered
View
15 man/panderOptions.Rd
@@ -49,11 +49,16 @@
affects \code{pander} methods. This option tells
\code{pander} where to split too wide cells with line
breaks. Set \code{Inf} to disable. \item
- \code{table.continues}: string (default: \code{'Table
- continues below'}) passed to \code{\link{pandoc.table}}
- to be used as caption for long (split) without a use
- defined caption \item \code{table.continues.affix}:
- string (default: \code{'(continued below)'}) passed to
+ \code{table.caption.prefix}: string (default:
+ \code{'Table: '}) passed to \code{\link{pandoc.table}} to
+ be used as caption prefix. Be sure about what you are
+ doing if changing to other than \code{'Table: '} or
+ \code{':'}. \item \code{table.continues}: string
+ (default: \code{'Table continues below'}) passed to
+ \code{\link{pandoc.table}} to be used as caption for long
+ (split) without a use defined caption \item
+ \code{table.continues.affix}: string (default:
+ \code{'(continued below)'}) passed to
\code{\link{pandoc.table}} to be used as an affix
concatenated to the user defined caption for long (split)
tables \item \code{evals.messages}: boolean (default:
Please sign in to comment.
Something went wrong with that request. Please try again.