Description Usage Arguments Value Author(s) Examples
View source: R/setCaptionNumbering.R
This function makes it easy to tell knitr (and so RMarkdown) to use numbered captions of any type.
1 2 3 4 5 6 7 | setCaptionNumbering(captionName = "tab.cap",
prefix = ":Table %s: ",
suffix = "",
captionBefore = FALSE,
romanNumeralSetting = "counter_roman",
optionName = paste0("setCaptionNumbering_", captionName),
resetCounterTo = 1)
|
captionName |
The name of the caption; this is used both as unique identifier for the counter, and to set the caption text (included between the prefix and suffix) in the chunk options. |
prefix |
The text to add as prefix before the action caption; this will typically include '%s%' which will be replaced by the number of this caption. |
suffix |
The text to add as suffix after the action caption; this can also include '%s%' which will be replaced by the number of this caption. Together with the |
captionBefore |
Whether the caption should appear before or after the relevant chunk output. |
romanNumeralSetting |
The name of the option (should be retrievable with |
optionName |
The name of the option to use to retrieve and set the counter. This can be used, for example, to have multiple caption types use the same counter. |
resetCounterTo |
If not |
This function returns nothing, but instead sets the appropriate knit_hooks
. Or rather, just one hook.
Gjalt-Jorn Peters
Maintainer: Gjalt-Jorn Peters <gjalt-jorn@userfriendlyscience.com>
1 2 3 4 5 | ## Not run:
setCaptionNumbering(captionName='tab.cap',
prefix = ":Table %s: ");
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.