使用 papaja 将数字编织成单词失败

knitting a figure to word using papaja fails

我可以将以下代码编织成 PDF。但是,在尝试将输出编织到 Word 时总是失败(win 10、Rstudio 1.2.5033、R 3.6.2、papaja 0.1.0.9942)。我必须删除 papaja header 才能发布(代码太多)。

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

# Methods

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

错误消息显示为

Error running filter D:/Boelte/R_library/papaja/rmd/docx_fixes.lua: [string "--[[..."]:227: Constructor for Emph failed: [string "--[[..."]:258: attempt to index a nil value (local 'x') stack traceback: [C]: in function 'error' ..."]:227: in field 'Emph' D:/Boelte/R_library/papaja/rmd/docx_fixes.lua:14: in function 'Image' Fehler: pandoc document conversion failed with error 83

有什么办法可以纠正这个错误吗?这是 papaja 还是 pandoc 错误?

这是一个 papaja 错误,通过 docx_fixes.lua-过滤器与文档的 post-processing 有关(在本例中为图形标题设置样式)。我会尽快解决这个问题。目前,您应该可以通过在块选项中指定图形标题来解决此问题。

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

# Methods

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

```{r figure, fig.cap = "(ref:fig-cap)"}
plot(cars)
```