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",
citation_package = c("none", "natbib", "biblatex"), includes = NULL,
md_extensions = NULL, pandoc_args = NULL)
TRUE
to include a table of contents in the outputTRUE
to number section headingsTRUE
to automatically apply the pdfcrop
utility
(if available) to pdf figuresTRUE
to render figures with captionsNULL
to prevent syntax highlighting.NULL
to use pandoc's
built-in template; pass a path to use a custom template that you've
created. See the documentation on
natbib
or biblatex
. Use none
if neither package is to be used.includes
function).rmarkdown_format
for
additional details.render
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
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:
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
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"))
Run the code above in your browser using DataCamp Workspace