2017-08-17 28 views
2

我有關於設置的word_document輸出邊距問題。
我瀏覽大量信息並找到reference
它可以使用geometry進行設置。但是,我只是希望文字輸出邊距變得非常小。我還發現this設置邊距。
但是,它沒有奏效。ř降價字ducument輸出邊距

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

如何弄清楚?

+2

我相信'geometry'是一個LaTeX包,如果你是它織成PDF纔會工作。只需使用Microsoft Word中的視圖標尺以您想要的方式定製您的邊距 – Onyambu

+2

並非所有pandoc的選項都可以通過「rmarkdown」獲得(並且您提供的第二個參考是Latex軟件包,當然它又有所不同!)。但是,您可以使用[此處介紹的樣式引用](http://rmarkdown.rstudio.com/word_document_format.html#style_reference)。 –

回答

3

使用之前用R markdown生成的word文檔將其命名爲margin_styles.docx,並調整該文檔中的邊距以適應所需的輸出。然後包括在rmarkdown(.Rmd)文件的YAML部分如下:

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

渲染的文件應該有margin_styles.docx設置頁邊距。

見rmarkdown文檔的樣式的引用部分以瞭解詳情http://rmarkdown.rstudio.com/word_document_format.html#style_reference