[Tex/LaTex] How does one set document class options (e.g. paper size) for LaTeX output

knitrr

The header option lets you insert TeX code in the preamble after \documentclass{article}, but what if I want to change the default paper size or the default font size?

For this, I would need to insert text between \documentclass and {article}, for instance: \documentclass[a4paper,10pt]{article}.

Update: I forgot to mention that I am using spin() to generate the PDF document via LaTeX.

Best Answer

Try this:

#' \documentclass[a4paper, 10pt]{article}
#' \begin{document}

mean(1:10)
plot(1:10)

#' \end{document}
Related Question