Automatic caption numbering knitr hooks for figures and tables
These function implement ideas by Max Gordon and DeanK (see Details) to add
knitr hooks to automate the numbering of figures and tables when generating R Markdown documents.
setFigCapNumbering(figure_counter_str = "Figure %s: ", figureClass = "", imgClass = "", figureInlineStyle = c("display:block"), imgInlineStyle = NULL) setTabCapNumbering(table_counter_str = ":Table %s: ")
- figure_counter_str, table_counter_str
- The string in which to add the number of the figure or table. The text '%s' will be replaced by the number.
Optionally, a css class to pass to the
HTML element that surrounds the .
- Optionall, a css class to pass to the HTML element.
- Any css style to pass to the figure element directly ('inline').
- Any css style to pass to the image element directly ('inline').
The figure caption function is basically the one designed by Max Gordon (see http://gforge.se/2014/01/fast-track-publishing-using-knitr-part-iii/.
The table caption function is an implementation of the ideas of DeanK (see http://stackoverflow.com/questions/15258233/using-table-caption-on-r-markdown-file-using-knitr-to-use-in-pandoc-to-convert-t) combined with Max Gordon's function.
Nothing is returned; the correct hooks are configured for
## Not run: # setFigCapNumbering("This is figure number %s, with caption text: "); # ## End(Not run)