使用classoption时,无法从R markdown生成横向微软word文档:landscape

问题描述 投票:1回答:1

使用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是统计编程语言,但问题不是统计问题。

谢谢。

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

r-markdown orientation landscape
1个回答
3
投票

感谢Ralf Stubner。

有一个很好的解释,如何在这里专门为这个词做这个过程: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
---
© www.soinside.com 2019 - 2024. All rights reserved.