rmd_cap: Capions in rmarkdown

Description Usage Arguments Details Functions Note See Also

Description

This function allows enumerated tables and figures in rmarkdown. In connection to a table or figure you use rmd_cap (or convenience functions tab_cap or fig_cap) to record a label and a number (within the typesinfo environment). Within the text you can then refer to them as `r rmd_ref(<label>)`.

Usage

1
2
3
4
5
rmd_cap(caption, label, type = NULL)

tab_cap(caption = "", label = NULL)

fig_cap(caption = "", label = NULL)

Arguments

caption

the caption

label

the label you can refer to in the .rmd document. If NULL it will inherit the 'label' from the current chunk

type

usually "Table" or "Figure". User do not have to care as you use tab_cap or fig_cap, which calls rmd_cap with this argument fixed

Details

The rmd_cap, and convinience functions tab_cap and fig_cap, keeps track of Figures and Tables. Use e.g. fig.cap = fig_cap("My Caption", "myLabel") in a chunk header and `r rmd_ref("myLab")` in your rmd document.

Functions

Note

You might have to knit your document twice for it to work. Relative changes or insertions of tables/figures probably requires you to reset the information on table/figure enumeration so far (use index_type_reset).

See Also

rmd_ref


renlund/enumeratermd documentation built on May 27, 2019, 5:51 a.m.