【发布时间】:2019-11-27 22:12:38
【问题描述】:
R 显示: 警告:错误:pandoc 文档转换失败,错误 1 [没有可用的堆栈跟踪]
output:
word_document:
fig_caption: yes
toc: true
toc_depth: 2
reference_docx: headingfive.docx
【问题讨论】:
标签: r output r-markdown
R 显示: 警告:错误:pandoc 文档转换失败,错误 1 [没有可用的堆栈跟踪]
output:
word_document:
fig_caption: yes
toc: true
toc_depth: 2
reference_docx: headingfive.docx
【问题讨论】:
标签: r output r-markdown
应该是 fig_caption: true,而不是 fig_caption: yes。
---
output:
word_document:
fig_caption: true
toc: true
toc_depth: 2
reference_docx: headingfive.docx
---
word_document 接受的参数可以通过检查?rmarkdown::word_document 来查看。这个帮助页面说fig_caption 是合乎逻辑的。
编辑(根据您的评论): 苍蝇“headingfive.docx”似乎不存在,或者您在错误的目录中。
如果您还没有该文件,您可以查看这两个链接以了解它是如何创建的:
https://www.r-bloggers.com/r-markdown-how-to-insert-page-breaks-in-a-ms-word-document/
How to add a page break in word document generated by RStudio & markdown
最后,您必须确保文件“headingfive.docx”在 R 的工作目录中(至少在 Ubuntu 上它需要在该目录中)。
【讨论】: