yml_latex_opts() sets top-level YAML fields for LaTeX options used by pandoc (see the documentation, from which these descriptions were derived), as when making a PDF document with pdf_document().

yml_latex_opts(
  .yml,
  block_headings = yml_blank(),
  classoption = yml_blank(),
  documentclass = yml_blank(),
  geometry = yml_blank(),
  indent = yml_blank(),
  linestretch = yml_blank(),
  margin_left = yml_blank(),
  margin_right = yml_blank(),
  margin_top = yml_blank(),
  margin_bottom = yml_blank(),
  pagestyle = yml_blank(),
  papersize = yml_blank(),
  secnumdepth = yml_blank(),
  fontenc = yml_blank(),
  fontfamily = yml_blank(),
  fontfamilyoptions = yml_blank(),
  fontsize = yml_blank(),
  mainfont = yml_blank(),
  sansfont = yml_blank(),
  monofont = yml_blank(),
  mathfont = yml_blank(),
  CJKmainfont = yml_blank(),
  mainfontoptions = yml_blank(),
  sansfontoptions = yml_blank(),
  monofontoptions = yml_blank(),
  mathfontoptions = yml_blank(),
  CJKoptions = yml_blank(),
  microtypeoptions = yml_blank(),
  colorlinks = yml_blank(),
  linkcolor = yml_blank(),
  filecolor = yml_blank(),
  citecolor = yml_blank(),
  urlcolor = yml_blank(),
  toccolor = yml_blank(),
  links_as_notes = yml_blank(),
  lof = yml_blank(),
  lot = yml_blank(),
  thanks = yml_blank(),
  toc = yml_blank(),
  toc_depth = yml_blank(),
  biblatexoptions = yml_blank(),
  biblio_style = yml_blank(),
  biblio_title = yml_blank(),
  bibliography = yml_blank(),
  natbiboptions = yml_blank()
)

Arguments

.yml

a yml object created by yml(), as_yml(), or returned by a yml_*() function

block_headings

make paragraph and subparagraph (fourth- and fifth-level headings, or fifth- and sixth-level with book classes) free-standing rather than run-in; requires further formatting to distinguish from subsubsection (third- or fourth-level headings). Note that the YAML field is actually called block-headings.

classoption

a character vector of options for document class, e.g. "oneside"

documentclass

the document class usually "article", "book", or "report"

geometry

a character vector of options for the geometry LaTeX package, e.g. "margin=1in"

indent

Logical. Use document class settings for indentation? The default LaTeX template otherwise removes indentation and adds space between paragraphs.

linestretch

adjusts line spacing using the setspace LaTeX package, e.g. 1.25, 1.5

margin_left, margin_right, margin_top, margin_bottom

sets margins if geometry is not used, otherwise geometry overrides these. Note that the actual YAML fields use - instead of _, e.g. margin-left.

pagestyle

control the pagestyle LaTeX command: the default article class supports "plain" (default), "empty" (no running heads or page numbers), and "headings" (section titles in running heads)

papersize

paper size, e.g. letter, a4

secnumdepth

numbering depth for sections (with --number-sections pandoc)

fontenc

allows font encoding to be specified through fontenc LaTeX package (with pdflatex); default is "T1" (see LaTeX font encodings guide)

fontfamily

font package for use with pdflatex: TeX Live includes many options, documented in the LaTeX Font Catalogue. The default is "Latin Modern".

fontfamilyoptions

a character vector of options for fontfamily.

fontsize

font size for body text. The standard classes allow "10pt", "11pt", and "12pt".

mainfont, sansfont, monofont, mathfont, CJKmainfont

font families for use with xelatex or lualatex: take the name of any system font, using the fontspec LaTeX package. CJKmainfont uses the xecjk LaTeX package..

mainfontoptions, sansfontoptions, monofontoptions, mathfontoptions, CJKoptions

a character vector of options to use with mainfont, sansfont, monofont, mathfont, CJKmainfont in xelatex and lualatex. Allow for any choices available through fontspec.

microtypeoptions

a character vector of options to pass to the microtype LaTeX package.

colorlinks

Logical. Add color to link text? Automatically enabled if any of linkcolor, filecolor, citecolor, urlcolor, or toccolor are set.

linkcolor, filecolor, citecolor, urlcolor, toccolor

color for internal links, external links, citation links, linked URLs, and links in table of contents, respectively: uses options allowed by xcolor, including the dvipsnames, svgnames, and x11names lists

links_as_notes

Logical. Print links as footnotes? Note that the actual YAML field is links-as-notes

lof, lot

Logical. Include list of figures or list of tables?

thanks

contents of acknowledgments footnote after document title

toc

include table of contents

toc_depth

level of section to include in table of contents. Note that the actual YAML field is toc-depth

biblatexoptions

list of options for biblatex.

biblio_style

bibliography style, when used with natbib and biblatex. Note that the actual YAML field is biblio-style

biblio_title

bibliography title, when used with natbib and biblatex. Note that the actual YAML field is biblio-title

bibliography

a path to the bibliography file to use for references

natbiboptions

a character vector of options for natbib

Value

a yml object

Examples

# \donttest{
yml() %>%
   yml_output(pdf_document()) %>%
   yml_latex_opts(
     fontfamily = "Fira Sans Thin",
     fontsize = "11pt",
     links_as_notes = TRUE
   )
#> ---
#> date: '`r format(Sys.Date())`'
#> output: pdf_document
#> fontfamily: Fira Sans Thin
#> fontsize: 11pt
#> links-as-notes: true
#> ---
#> 
# }