2

我能够将以下代码编织成 PDF。但是,尝试将输出编织到 Word 时总是失败(win 10,Rstudio 1.2.5033,R 3.6.2,papaja 0.1.0.9942)。我不得不删除 papaja 标头才能发布(代码太多)。

```{r setup, include = FALSE}
library("papaja")
```

# Methods

```{r figure}
plot(cars)
```

错误消息读取

运行过滤器 D:/Boelte/R_library/papaja/rmd/docx_fixes.lua 时出错:[string"--[[..."]:227: Emph 的构造函数失败:[string"--[[..."] :258:尝试索引一个零值(本地'x')堆栈回溯:[C]:在函数'错误'中......“]:227:在字段'Emph'中D:/Boelte/R_library/papaja/rmd /docx_fixes.lua:14:在函数“图像”Fehler 中:pandoc 文档转换失败,错误 83

有没有办法纠正这个错误?这是一个 papaja 还是 pandoc 错误?

4

1 回答 1

2

这是与通过-filterpapaja对文档进行后处理(在本例中为图形标题样式)相关的错误。docx_fixes.lua我会尽快解决这个问题。目前,您应该能够通过在块选项中指定图形标题来解决此问题。

```{r setup, include = FALSE}
library("papaja")
```

# Methods

(ref:fig-cap) This is the figure caption.

```{r figure, fig.cap = "(ref:fig-cap)"}
plot(cars)
```
于 2020-02-10T22:26:29.453 回答