R markdown word ducument输出边距

时间:2017-08-17 03:46:44

标签: r output r-markdown margins

我有一个关于设置rmarkdown word_document 输出边距的问题。
我浏览了大量信息并找到了http://metronetx.hgcbiz.com/npp/index.php 它可以使用geometry进行设置。但是,我只想让字输出边距变得非常小。我还找到reference来设置边距 但是,它没有用。

---
title: "Set Margins"
output: word_document
geometry: margins: left = 0.1 cm
                   right = 0.1 cm 
---

如何搞清楚?

1 个答案:

答案 0 :(得分:2)

使用之前使用R markdown生成的word文档将其命名为margin_styles.docx,并调整该文档中的边距以适合所需的输出。然后在rmarkdown(.Rmd)文件的yaml部分中包含以下内容:

---
output:
  word_document:
    reference_docx: margin_styles.docx
---

渲染文件的边距应设为margin_styles.docx

有关详细信息http://rmarkdown.rstudio.com/word_document_format.html#style_reference

,请参阅rmarkdown文档的样式参考部分
相关问题