How can I change paper size when using Knit PDF in RStudio? How can I change paper size when using Knit PDF in RStudio? r r

How can I change paper size when using Knit PDF in RStudio?


OK, so I figured it out. In the .Rmd file's header, options documentclass and classoption get written into the preamble of the resulting .tex file. The article document class accepts a number of paper size options including a4paper. The header in the .Rmd file will then look something like this:

---title: "Title"author: "Name"date: "Date"output:  pdf_documentdocumentclass: articleclassoption: a4paper---

For more information see: http://rmarkdown.rstudio.com/pdf_document_format.html


At least in newer versions of the rmarkdown R package (and Pandoc) you can just set:

---output: pdf_documentpapersize: a4---