Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

html_document2

Output formats that allow numbering and cross-referencing figures/tables/equations


Description

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,
  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,
  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.

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.

References


bookdown

Authoring Books and Technical Documents with R Markdown

v0.22
GPL-3
Authors
Yihui Xie [aut, cre] (<https://orcid.org/0000-0003-0645-5666>), JJ Allaire [ctb], Albert Kim [ctb], Alessandro Samuel-Rosa [ctb], Andrzej Oles [ctb], Atsushi Yasumoto [ctb] (<https://orcid.org/0000-0002-8335-495X>), Aust Frederik [ctb] (<https://orcid.org/0000-0003-4900-788X>), Bastiaan Quast [ctb], Ben Marwick [ctb], Chester Ismay [ctb], Christophe Dervieux [ctb], Clifton Franklund [ctb], Daniel Emaasit [ctb], David Shuman [ctb], Dean Attali [ctb], Drew Tyre [ctb], Ellis Valentiner [ctb], Frans van Dunne [ctb], Hadley Wickham [ctb], Jeff Allen [ctb], Jennifer Bryan [ctb], Jonathan McPhers [ctb], JooYoung Seo [ctb] (<https://orcid.org/0000-0002-4064-6012>), Joyce Robbins [ctb], Junwen Huang [ctb], Kevin Cheung [ctb], Kevin Ushey [ctb], Kim Seonghyun [ctb], Kirill Muller [ctb], Luciano Selzer [ctb], Matthew Lincoln [ctb], Maximilian Held [ctb], Michael Sachs [ctb], Michal Bojanowski [ctb], Nathan Werth [ctb], Noam Ross [ctb], Peter Hickey [ctb], Pedro Rafael D. Marinho [ctb] (<https://orcid.org/0000-0003-1591-8300>), Romain Lesur [ctb] (<https://orcid.org/0000-0002-0721-5595>), Sahir Bhatnagar [ctb], Shir Dekel [ctb] (<https://orcid.org/0000-0003-1773-2446>), Steve Simpson [ctb], Thierry Onkelinx [ctb] (<https://orcid.org/0000-0001-8804-4216>), Vincent Fulco [ctb], Yixuan Qiu [ctb], Zhuoer Dong [ctb], RStudio, PBC [cph], Bartek Szopka [ctb] (The jQuery Highlight plugin), Zeno Rocha [cph] (clipboard.js library), jQuery Foundation [cph] (jQuery library), jQuery contributors [ctb, cph] (jQuery library; authors listed in inst/resources/AUTHORS), MathQuill contributors [ctb] (The MathQuill library; authors listed in inst/resources/AUTHORS), FriendCode Inc [cph, ctb] (The gitbook style, with modifications)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.