r-markdown - 使用 classoption : landscape 时无法从 R markdown 生成横向的 microsoft word 文档

标签 r-markdown orientation landscape

使用 RStudio 和 Rmarkdown 时,我无法生成横向文档。

R 是版本 3.4.2
RStudio 是版本 0.98.1103

我无法更改这些,因为它们是我运行程序的集群上的最新版本。

编织文件后,我确实得到了一个文件(以纵向形式),但是收到以下错误消息:

Output created: test_landscape.docx
Warning message:
In (function (toc = FALSE, toc_depth = 3, fig_width = 5, fig_height = 4,  :
  table of contents for word_document requires pandoc >= 1.14

可重现的代码在这里:
---
title: "test_landscape"
author: "Name"
date: "09/10/2018"
output: word_document
classoption: landscape
---

Test for landscape orientation

```{r}
summary(cars)
```

You can also embed plots, for example:

```{r, echo=FALSE}
plot(cars)
```

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

不确定这是否更适合交叉验证,因为 R 是一种统计编程语言,但问题不是统计语言。

谢谢你。

编辑:在下面的评论后编辑标题以更好地代表我的问题。

最佳答案

感谢拉尔夫·斯图纳。

对于如何在此处专门针对 word 执行此操作的过程,有一个很好的解释:https://rmarkdown.rstudio.com/articles_docx.html

您必须创建一个具有所需设置(例如横向)的 Word 文档,将其保存在与 .Rmd 文件相同的位置,然后将其作为引用文档引用,例如:

---
title: "test_landscape"
author: "Name"
date: "09/10/2018"
output: 
  word_document:
    reference_docx: word_styles.docx
---

关于r-markdown - 使用 classoption : landscape 时无法从 R markdown 生成横向的 microsoft word 文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52719576/

相关文章:

r - 从 RMarkdown 中提取 LaTeX 图形和标题标签列表以复制到 Overleaf 中

ios - 不同的纵向和横向自动布局约束 : where to set them when the device is firSTLy in landscape?

objective-c - UIView 未检测到横向触摸

android - 仅使用横向模式为 iPad 和平板电脑制作 React native 应用程序的正确方法

r - kableExtra 中的度数符号

r - rmarkdown block 中的条件 `echo`(或eval或include)

r - rmarkdown中的内部链接不起作用

iphone - 无论旋转如何锁定方向

以错误的方向保存的 Android 自定义相机图像

android - 如何根据手机方向(横向,纵向)绘制 Canvas ?