Changing word template for knitr in Rmarkdown

2019-01-24 09:07发布

问题:

I'm using Rstudio to make a markdown document which I want to convert to a word document. I would like to change word template that is automatically generated when you knit to Word. For example, I want the margins to be narrow when I knit to word.

I'm on a Windows 64 bit, with Windows 7.

回答1:

I prepared a video for this task. Please see if it helps. Basically you generate a Word document from an arbitrary R Markdown document, then modify the styles in the Word output document, and use this document as the template for future R Markdown documents.