Render the input file to the specified output format using
pandoc. If the input requires knitting then
knit is called prior to pandoc.
render(input, output_format = NULL, output_file = NULL, output_options = NULL, clean = TRUE, envir = parent.frame(), quiet = FALSE, encoding = getOption("encoding"))
Input file (Rmd or plain markdown)
R Markdown output format to convert to. This can
be a character vector with the name of a format; e.g.
Alternatively it can be an output format object; e.g.
NULL is passed then the output format is read from the YAML
metadata within the input file (defaulting to HTML if no format is specified
List of output options that can override the options
specified in metadata (e.g. could be used to force
mathjax = "local"). Note that this is only valid when the output
format is read from metadata (i.e. not a custom format object passed to
Output file (if not specified then a default based on the specified output format is chosen)
TRUE to clean intermediate files created
The environment in which the code chunks are
to be evaluated during knitting (can use
new.env() to guarantee an empty new
TRUE to supress printing of the
pandoc command line
the encoding of the input file; see
The compiled document is written into the output file, and the path of the output file is returned.
R Markdown supports all of the base pandoc markdown
features as well as some optional features for
compatibility with GitHub Flavored Markdown (which
previous versions of R Markdown were based on). See
rmarkdown_format for details.
output_format parmaeter is specified then the output
format is read from the YAML front-matter of the input
file. For example, the following YAML would yield a PDF
Additional format options can also be specified in metadata. For example:
output: pdf_document: toc: true highlight: zenburn
Multiple formats can be specified in metadata. If no
is passed to
render then the first one defined will be used:
output: pdf_document: toc: true highlight: zenburn html_document: toc: true theme: united
If there is no format defined in the YAML then
html_document will be used.