本文介绍了在 rmarkdown pdf 中更改纸张大小和方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 A3(或 11x17,理想情况下)和横向的 rmarkdown 创建 PDF.我可以通过在 YAML 标头中指定选项来完成其中一项工作,但不能同时指定两者.这是我最好的尝试 - 每个 classoption 值单独工作,但不能一起工作:

I'd like to create a PDF using rmarkdown that is A3 (or 11x17, ideally) and in landscape orientation. I can get it to do one or the other by specifying options in the YAML header, but not both at the same time. Here's my best attempt - the classoption values each work individually, but not together:

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

这个问题 是相关的,但在这种情况下没有答案.提前感谢您提供的任何帮助!

This question is related, but doesn't have the answer in this case. Thanks in advance for any help you can provide!

推荐答案

好像没有文档,但是你可以包含多个classoption,方法是用逗号分隔选项或者使用带有连字符的项目符号列表.以下任一方法都可以:

It doesn't seem to be documented, but you can include more than one classoption by separating the options with commas or by using a bulleted list with hyphens. Either of the following will work:

---
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
---

这篇关于在 rmarkdown pdf 中更改纸张大小和方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 02:16
查看更多