在rmarkdown的pdf中更改纸张大小和方向

10
我想使用rmarkdown创建一个A3大小(最好是11x17)的横向方向的PDF。我可以通过在YAML头中指定选项来实现其中之一,但无法同时实现两者。这是我最好的尝试-每个classoption值都可以单独工作,但不能同时工作:
---
title: "Test"
output: 
  pdf_document:
    toc: true
    number_sections: true
documentclass: article
classoption: 
  landscape
  a3paper
---

这个问题与此相关,但在这种情况下没有答案。非常感谢您能提供的任何帮助!

1个回答

16

似乎没有文档记录,但是你可以通过使用逗号分隔选项或使用带连字号的项目符号列表来包含多个classoption。以下两种方式都可以:

---
title: "Test"
output: 
  pdf_document:
    toc: true
    number_sections: true
documentclass: article
classoption: 
  - landscape
  - a3paper
---


---
title: "Test"
output: 
  pdf_document:
    toc: true
    number_sections: true
documentclass: article
classoption: landscape, a3paper
---

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接