我有一个 Rmarkdown 文档,我正在将其输出到 Word,并且我正在尝试将公司徽标插入到页面顶部,位于包含标题和作者的标题上方。
我还没有找到解决这个问题的办法。我尝试过使用pandoc_args
to --include-in-header
,但这并不成功。但我不确定我是否正确使用了它。
是否可以在标题上方添加图片?
---
title: "Untitled"
author: "r.bot"
date: "Thursday, January 1, 2015"
output:
word_document:
fig_caption: yes
fig_height: 5
fig_width: 5
reference_docx: template.docx
pandoc_args: [
"--include-in-header", "C:\\path\\to\\file.png"
]
---
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
这可以通过在 Word 模板中使用图像标题来实现。在 Word 2010 中,转到:插入标题 -> 图像并添加所选图像。将此文档另存为template_image.docx
与 .Rmd 文件位于同一文件夹中。
然后,在 YAML 标头中:
---
title: "Untitled"
author: "Simon"
date: "Thursday, May 21, 2015"
output:
word_document:
fig_caption: yes
fig_height: 5
fig_width: 5
reference_docx: template_image.docx
---
编织 .Rmd 文件,输出应包含图像。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)