Description Usage Arguments Details Value Examples
Format for converting from R Markdown to a PDF document.
1 2 3 4 5 | pdf_document(toc = FALSE, toc_depth = 2, number_sections = FALSE,
fig_width = 6.5, fig_height = 4.5, fig_crop = TRUE,
fig_caption = FALSE, dev = "pdf", highlight = "default",
template = "default", keep_tex = FALSE, latex_engine = "pdflatex",
includes = NULL, md_extensions = NULL, pandoc_args = NULL)
|
toc |
|
toc_depth |
Depth of headers to include in table of contents |
number_sections |
|
fig_width |
Default width (in inches) for figures |
fig_height |
Default width (in inches) for figures |
fig_crop |
|
fig_caption |
|
dev |
Graphics device to use for figure output (defaults to pdf) |
highlight |
Syntax highlighting style. Supported styles include
"default", "tango", "pygments", "kate", "monochrome", "espresso",
"zenburn", and "haddock". Pass |
template |
Pandoc template to use for rendering. Pass "default" to use
the rmarkdown package default template; pass |
keep_tex |
Keep the intermediate tex file used in the conversion to PDF |
latex_engine |
LaTeX engine for producing PDF output. Options are "pdflatex", "lualatex", and "xelatex". |
includes |
Named list of additional content to include within the
document (typically created using the |
md_extensions |
Markdown extensions to be added or removed from the
default definition or R Markdown. See the |
pandoc_args |
Additional command line options to pass to pandoc |
See the online
documentation for additional details on using the pdf_document
format.
Creating PDF output from R Markdown requires that LaTeX be installed.
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.
Many aspects of the LaTeX template used to create PDF documents can be customized using metadata. For example:
--- |
title: "Crop Analysis Q3 2013" |
fontsize: 11pt |
geometry: margin=1in |
---
|
Available metadata variables include:
lang
Document language code
fontsize
Font size (e.g. 10pt, 11pt, 12pt)
documentclass
LaTeX document class (e.g. article)
classoption
Option for documentclass
(e.g. oneside); may be repeated
geometry
Options for geometry class (e.g. margin=1in); may be repeated
mainfont, sansfont, monofont, mathfont
Document fonts (works only with xelatex and lualatex, see the latex_engine
option)
linkcolor, urlcolor, citecolor
Color for internal, external, and citation links (red, green, magenta, cyan, blue, black)
linestretch
Options for line spacing (e.g. 1, 1.5, 3)
R Markdown output format to pass to render
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
library(rmarkdown)
# simple invocation
render("input.Rmd", pdf_document())
# specify an option for latex engine
render("input.Rmd", pdf_document(latex_engine = "lualatex"))
# add a table of contents and pass an option to pandoc
render("input.Rmd", pdf_document(toc = TRUE, "--listings"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.