Rmarkdown::: Cheat Sheet
Rmarkdown::: Cheat Sheet
Rmarkdown::: Cheat Sheet
RStudio® is a trademark of RStudio, PBC • CC BY SA RStudio • [email protected] • 844-448-1212 • rstudio.com • Learn more at rmarkdown.rstudio.com • rmarkdown 2.9.4 • Updated: 2021-08
ft
ft
ft
ft
ft
ft
MS Word
MS PPT
HTML
PDF
Use the document's YAML header to set an output IMPORTANT OPTIONS DESCRIPTION When you render a
format and customize it with output options. anchor_sections Show section anchors on mouse hover (TRUE or FALSE) X document, rmarkdown:
--- citation_package The LaTeX package to process citations ("default", "natbib", "biblatex") X 1. Runs the code and embeds
title: "My Document" results and text into an .md
author: "Author Name" code_download Give readers an option to download the .Rmd source code (TRUE or FALSE) X
file with knitr.
output: code_folding Let readers to toggle the display of R code ("none", "hide", or "show") X
html_document: Indent format 2 characters, 2. Converts the .md file into the output format with
toc: TRUE css CSS or SCSS file to use to style document (e.g. "style.css") X Pandoc.
indent options 4 characters
--- dev Graphics device to use for figure output (e.g. "png", "pdf") X X HTML
knitr pandoc
.Rmd .md PDF
df_print Method for printing data frames ("default", "kable", "tibble", "paged") X X X X DOC
OUTPUT FORMAT CREATES
html_document .html fig_caption Should figures be rendered with captions (TRUE or FALSE) X X X X
Save, then Knit to preview the document output.
pdf_document* .pdf highlight Syntax highlighting ("tango", "pygments", "kate", "zenburn", "textmate") X X X The resulting HTML/PDF/MS Word/etc. document will
word_document Microso Word (.docx) includes File of content to place in doc ("in_header", "before_body", "a er_body") X X be created and saved in the same directory as
powerpoint_presentation Microso Powerpoint (.pptx)
the .Rmd file.
keep_md Keep the Markdown .md file generated by knitting (TRUE or FALSE) X X X X
odt_document OpenDocument Text Use rmarkdown::render() to render/knit in the R
keep_tex Keep the intermediate TEX file used to convert to PDF (TRUE or FALSE) X
rtf_document Rich Text Format console. See ?render for available options.
latex_engine LaTeX engine for producing PDF output ("pdflatex", "xelatex", or "lualatex") X
md_document Markdown
github_document
ioslides_presentation
Markdown for Github
ioslides HTML slides
reference_docx/_doc
theme
docx/pptx file containing styles to copy in the output (e.g. "file.docx", "file.pptx")
Theme options (see Bootswatch and Custom Themes below) X
X X
Share
Publish on RStudio Connect
slidy_presentation Slidy HTML slides toc Add a table of contents at start of document (TRUE or FALSE) X X X X to share R Markdown documents
beamer_presentation* Beamer slides toc_depth The lowest level of headings to add to table of contents (e.g. 2, 3) X X X X securely, schedule automatic
* Requires LaTeX, use tinytex::install_tinytex()
toc_float Float the table of contents to the le of the main document content (TRUE or FALSE) X updates, and interact with parameters in real time.
Also see flexdashboard, bookdown, distill, and blogdown.
Use ?<output format> to see all of a format's options, e.g. ?html_document rstudio.com/products/connect/
RStudio® is a trademark of RStudio, PBC • CC BY SA RStudio • [email protected] • 844-448-1212 • rstudio.com • Learn more at rmarkdown.rstudio.com • rmarkdown 2.9.4 • Updated: 2021-08
ft
ft
ft
ft