Skip to content

These are simple wrappers of the output format functions like rmarkdown::html_document(), and they added the capability of numbering figures/tables/equations/theorems and cross-referencing them. See ‘References’ for the syntax. Note you can also cross-reference sections by their ID's using the same syntax when sections are numbered. In case you want to enable cross reference in other formats, use markdown_document2 with base_format argument.

Usage

html_document2(
  ...,
  number_sections = TRUE,
  global_numbering = !number_sections,
  pandoc_args = NULL,
  base_format = rmarkdown::html_document
)

html_fragment2(..., number_sections = FALSE)

html_notebook2(..., number_sections = FALSE)

html_vignette2(..., number_sections = FALSE)

ioslides_presentation2(..., number_sections = FALSE)

slidy_presentation2(..., number_sections = FALSE)

tufte_html2(..., number_sections = FALSE)

pdf_document2(...)

beamer_presentation2(..., number_sections = FALSE)

tufte_handout2(...)

tufte_book2(...)

markdown_document2(
  number_sections = TRUE,
  fig_caption = TRUE,
  md_extensions = NULL,
  global_numbering = !number_sections,
  pandoc_args = NULL,
  ...,
  base_format = rmarkdown::md_document
)

context_document2(...)

github_document2(...)

odt_document2(...)

powerpoint_presentation2(...)

rtf_document2(...)

word_document2(...)

Arguments

..., fig_caption, md_extensions, pandoc_args

Arguments to be passed to a specific output format function. For a function foo2(), its arguments are passed to foo(), e.g. ... of html_document2() are passed to rmarkdown::html_document().

number_sections

Whether to number section headers: if TRUE, figure/table numbers will be of the form X.i, where X is the current first-level section number, and i is an incremental number (the i-th figure/table); if FALSE, figures/tables will be numbered sequentially in the document from 1, 2, ..., and you cannot cross-reference section headers in this case.

global_numbering

If TRUE, number figures and tables globally throughout a document (e.g., Figure 1, Figure 2, ...). If FALSE, number them sequentially within sections (e.g., Figure 1.1, Figure 1.2, ..., Figure 5.1, Figure 5.2, ...). Note that global_numbering = FALSE will not work with number_sections = FALSE because sections are not numbered.

base_format

An output format function to be used as the base format.

Value

An R Markdown output format object to be passed to rmarkdown::render().

Note

These output formats are used to generate single output files, such as a single HTML output file (unlike gitbook, which generates multiple HTML output files by default).

The functions tufte_*() are wrappers of functions in the tufte package.