Clean HTML documents with R Markdown.
html_document_clean(
...,
theme = "no-class",
css = NULL,
toc = FALSE,
toc_depth = 3,
title_in_header = TRUE,
mathjax = NULL,
use_fontawesome = FALSE,
fig_width = 10,
fig_height = 7,
fig_retina = 2,
keep_md = FALSE,
dev = "png",
highlight = "default",
pandoc_args = NULL,
extra_dependencies = NULL,
md_extensions = NULL,
self_contained = !is.null(theme)
)Additional function arguments to pass to the base R Markdown HTML
output formatter html_document_base
The class-less CSS theme to use, one of cleanrmd_themes().
CSS and/or Sass files to include. Files with an extension of .sass
or .scss are compiled to CSS via sass::sass(). Also, if theme is a
bslib::bs_theme() object, Sass code may reference the relevant Bootstrap
Sass variables, functions, mixins, etc.
TRUE to include a table of contents in the output
Depth of headers to include in table of contents
If TRUE (default), the title, subtitle, author, and
date are placed in a <header> tag. This is semantically correct HTML but
some CSS frameworks work better with this structure than others.
Include mathjax. The "default" option uses an https URL from a
MathJax CDN. The "local" option uses a local version of MathJax (which is
copied into the output directory). You can pass an alternate URL or pass
NULL to exclude MathJax entirely.
Should links to FontAwesome be included in the HTML
document's <head>? Only enable if you are including FontAwesome icons in
your HTML document.
Default width (in inches) for figures
Default height (in inches) for figures
Scaling to perform for retina displays (defaults to 2, which
currently works for all widely used retina displays). Set to NULL 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).
Keep the markdown file generated by knitting.
Graphics device to use for figure output (defaults to png)
Syntax highlight engine and style, either a built-in Pandoc
highlighting theme, a theme provided by rmarkdown, or a
prismjs theme (see below). Pass
NULL to prevent syntax highlighting.
Pandoc themes. By default, uses Pandoc's highlighting style. Pandoc's built-in styles include "tango", "pygments", "kate", "monochrome", "espresso", "zenburn", "haddock" and "breezedark".
Two custom styles are also included, "arrow", an accessible color scheme,
and "rstudio", which mimics the default IDE theme. Alternatively, supply a
path to a .theme to use
a custom Pandoc style.
Note that custom themes require Pandoc 2.0+.
Prism themes. To use the prismjs
syntax highlighter, pass one of "prism", "prism-coy", "prism-dark",
"prism-funky", "prism-okaidia", "prism-solarizedlight", "prism-tomorrow",
or "prism-twilight". To use an alternate Prism theme file, pass the URL or
path to the theme's CSS file prefixed with "prism:", e.g.
prism:my-theme.css. Note that the Prism dependencies are not embedded
into self-contained documents so they will require an active internet
connection to work.
Additional command line options to pass to pandoc
Extra dependencies as a list of the
html_dependency class objects typically generated by
htmltools:htmlDependency().
Markdown extensions to be added or removed from the
default definition of R Markdown. See the rmarkdown_format for
additional details.
Produce a standalone HTML file with no external dependencies, using data: URIs to incorporate the contents of linked scripts, stylesheets, images, and videos. Note that even for self contained documents MathJax is still loaded externally (this is necessary because of its size).
An R Markdown output format that can be used with output: in an
.Rmd or for use with rmarkdown::render().
Note that MathJax is disabled by default to reduce the
overall size of the final document. You can enable MathJax by setting
mathjax = "default", see rmarkdown::html_document() for more options.
use_cleanrmd() for using cleanrmd themes in places other than in
R Markdown documents
if (interactive()) {
html_document_clean()
}
if (FALSE) { # \dontrun{
rmarkdown::render("input.Rmd", html_document_clean())
} # }