使用 officedown::rdocx_document 时,Rmd 报告不会从模板导入边距、页眉或页脚:

问题描述

编辑:

我再次安装了以前版本的软件包(版本 0.2.1),问题解决了。

__

我正在使用 Rmarkdown 包制作 officedown 报告。

我的Word输出很好地导入了模板文档的Word Styles,但是没有导入同一个模板的页边距、页眉或页脚,sintax有变化吗?,这里是报告的YAML:

---
output:
  officedown::rdocx_document:
   reference_docx: template.docx
---   

模板与 officer 包一起使用时效果很好,或者与“普通”单词输出一起使用时,如下所示:

---
output:
  word_document:
    reference_docx: template.docx
---

有什么想法吗?

非常感谢您的帮助,去年我一直在使用 officeverse 软件包,这些都很棒

解决方法

我遇到了同样的问题,但您可以按照 Officeverse book 中所述在 YAML 标头中设置这些参数。

以英寸为单位

output: 
  officedown::rdocx_document:
  page_size:
    width: 8.3
    height: 11.7
    orient: "portrait"
  page_margins:
    bottom: 1
    top: 1
    right: 1.25
    left: 1.25
    header: 0.5
    footer: 0.5
    gutter: 0.5