How to specify a customized paper size in r markdown

不问归期 提交于 2019-12-11 03:02:43

问题


I am using R Markdown to produce a booklet with specific height and length measures. Is there a way to specify to R Markdown to produce the article in 5.5"x8.5" measures.

I saw questions asked about producing A4 size pdf here but that does not help as my measure is very specific.


回答1:


Use the geometry option in the YAML (which becomes options to the geometry package in LaTeX). For example:

---
title: "Title"
author: "Me"
geometry: paperheight=8.5in,paperwidth=5.5in,margin=1in
output:
    pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown

This is an R Markdown document. Markdown is a simple formatting
syntax for authoring HTML, PDF, and MS Word documents. For more
details on using R Markdown see <http://rmarkdown.rstudio.com>.


来源:https://stackoverflow.com/questions/54526126/how-to-specify-a-customized-paper-size-in-r-markdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!