I am producing reports using rmarkdown. When knitting a PDF
---
title: \"Untitled\"
output: pdf_document
---
I would like to specify the fo
The indentation in YAML options is meaningful. As the instructions point out "note that these options do not appear underneath the output section but rather appear at the top level along with title, author, etc.)". So,
---
output:
pdf_document:
latex_engine: xelatex
sansfont: Calibri Light
---
will produce an unused argument error, while
---
output:
pdf_document:
latex_engine: xelatex
sansfont: Calibri Light
---
will do the job. In addition, LaTeX commands inserted after YAML seem to override it: so
---
output:
pdf_document:
latex_engine: xelatex
sansfont: Calibri Light
---
\fontsize{12}{22}
\fontseries{b}
\selectfont
produces the PDF with default font, not Calibri, however, the font option is passed fine.
Just a quick example. add these lines to your RMD main text area and see the effects.
\fontfamily{cmr}
\fontsize{12}{22}
\fontseries{b}
\selectfont
Hope this may help