在rmarkdown pdf中更改纸张尺寸和方向 [英] Change paper size and orientation in an rmarkdown pdf

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

问题描述

我想使用rmarkdown创建A3(理想情况下为11x17)并横向放置的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中更改纸张尺寸和方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆