r - 为什么我的 r-markdown docx 输出“reference_docx:headingfive.docx”不起作用?
问题描述
R 显示:警告:错误:pandoc 文档转换失败,错误 1 [没有可用的堆栈跟踪]
output:
word_document:
fig_caption: yes
toc: true
toc_depth: 2
reference_docx: headingfive.docx
解决方案
它应该是 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/
如何在 RStudio 和 markdown 生成的 word 文档中添加分页符
最后,您必须确保文件“headingfive.docx”位于 R 的工作目录中(至少在 Ubuntu 上它需要位于该目录中)。
推荐阅读
- .net - 在 SQL Server 2017 中使用 Cryptography.RSACryptoServiceProvider 程序集进行解密
- javascript - 在这个小代码上疯狂,chrome.runtime.onMessage 总是给出未定义的。我能做些什么?
- python - 我应该为每个单独的 Django 项目需要单独的虚拟环境吗
- java - 将 java 类转换为通用 kotlin 类会改变调用哪个函数
- html - 加入不显示所选项目 - 使用 Svelte
- python - 如何在 Google Drive API 中按路径查找文件夹 ID?
- javascript - useMutation 后 useQuery 未正确更新并设置 cookie 以进行授权
- reactjs - 找不到 Dropbox 登录窗口的图像
- reactjs - 如何使用 selenium 刮取隐藏的 React 组件键
- git - 使用 API 命令获取拉取请求的工作项的权限错误