html_document(toc = FALSE, toc_depth = 3, toc_float = FALSE, number_sections = FALSE, fig_width = 7, fig_height = 5, fig_retina = 2, fig_caption = TRUE, dev = "png", df_print = "default", code_folding = c("none", "show", "hide"), code_download = FALSE, smart = TRUE, self_contained = TRUE, theme = "default", highlight = "default", mathjax = "default", template = "default", extra_dependencies = NULL, css = NULL, includes = NULL, keep_md = FALSE, lib_dir = NULL, md_extensions = NULL, pandoc_args = NULL, ...)
TRUE
to include a table of contents in the outputTRUE
to float the table of contents to the left of the
main document content. Rather than TRUE
you may also pass a list of
options that control the behavior of the floating table of contents. See the
Floating Table of Contents section below for details.TRUE
to number section headingsNULL
to
prevent retina scaling. Note that this will always be NULL
when
keep_md
is specified (this is because fig_retina
relies on
outputting HTML directly into the markdown document).TRUE
to render figures with captionsprint.data.frame
. The "kable" method uses the
knitr::kable
function. The "tibble" method uses
the tibble package to print a summary of the data frame. The "paged"
method creates a paginated HTML table (note that this method is only valid
for formats that produce HTML). In addition
to the named methods you can also pass an arbitrary function to be used
for printing data frames. You can disable the df_print behavior entirely
by setting the option rmarkdown.df_print
to FALSE
."none"
to display all code chunks (assuming
they were knit with echo = TRUE
). Specify "hide"
to hide all R
code chunks by default (users can show hidden code chunks either
individually or document-wide). Specify "show"
to show all R code
chunks by default.NULL
for no theme (in this case you can
use the css
parameter to add your own styles).NULL
to prevent syntax highlighting.NULL
to exclude MathJax entirely.NULL
to use pandoc's
built-in template; pass a path to use a custom template that you've created.
Note that if you don't use the "default" template then some features of
html_document
won't be available (see the Templates section below for
more details).html_document_base
includes
function)._files
appended to it.rmarkdown_format
for
additional details.render
title
, type
, left
, and
right
fields (to define menu items for the left and right of the navbar
resspectively). Menu items include title
and href
fields. For example: title: "My Website" type: default left: - text: "Home" href: index.html - text: "Other" href: other.html right: - text: GitHub href: https://github.comThe
type
field is optional and can take the value "default" or "inverse" (which
provides a different color scheme for the navigation bar). Alternatively, you can include a "_navbar.html" file which is a full HTML definition
of a bootstrap navigation bar. For a simple example of including a navigation bar see
https://github.com/rstudio/rmarkdown-website/blob/master/_navbar.html.
For additional documentation on creating Bootstrap navigation bars see
http://getbootstrap.com/components/#navbar.toc_float
parameter which
control the behavior of the floating table of contents. Options include: collapsed
(defaults to TRUE
) controls whether
the table of contents appears with only the top-level (H2) headers. When
collapsed the table of contents is automatically expanded inline when
necessary. smooth_scroll
(defaults to TRUE
) controls
whether page scrolls are animated when table of contents items are navigated
to via mouse clicks. print
(defaults to TRUE
) controls
whether the table of contents appears when user prints out the HTML page..tabset
class
attribute to headers within a document. This will cause all sub-headers of
the header with the .tabset
attribute to appear within tabs rather
than as standalone sections. For example: ## Quarterly Results {.tabset} ### By Product ### By RegionYou can also specify two additional attributes to control the appearance and behavior of the tabs. The
.tabset-fade
attributes causes the tabs to
fade in and out when switching. The .tabset-pills
attribute causes
the visual appearance of the tabs to be "pill" rather than traditional tabs.
For example: ## Quarterly Results {.tabset .tabset-fade .tabset-pills}
template = NULL
. Note however that if you choose not to use the "default" HTML template then
several aspects of HTML document rendering will behave differently: theme
parameter does not work (you can still
provide styles using the css
parameter). highlight
parameter, the default highlighting style will resolve to
"pygments" and the "textmate" highlighting style is not available
toc_float
parameter will not work. code_folding
parameter will not work. self_contained
is
TRUE
(these two options can't be used together in normal pandoc
templates). includes
parameter as an alternative to providing a fully custom template.html_document
format.R Markdown documents can have optional metadata that is used to generate a document header that includes the title, author, and date. For more details see the documentation on R Markdown metadata.
R Markdown documents also support citations. You can find more information on the markdown syntax for citations in the Bibliographies and Citations article in the online documentation.
## Not run:
#
# library(rmarkdown)
#
# render("input.Rmd", html_document())
#
# render("input.Rmd", html_document(toc = TRUE))
# ## End(Not run)
Run the code above in your browser using DataLab