如何在RStudio& amp;生成的Word文档中添加分页符降价 [英] How to add a page break in word document generated by RStudio & markdown
问题描述
我在R Studio中用R降价编写了一个Word文档.我可以得到很多东西,但是目前我还没有弄清楚如何获得分页符.我找到了解决方案,但仅针对渲染的乳胶/pdf文档,这不是我的情况.
I writing a Word document with R markdown in R Studio. I can get many things, but at the moment I am not figuring out how can I get a page break. I have found solutions but only for rendered latex / pdf document that it is not my case.
推荐答案
使用第五层标头块(#####
)和YAML中定义的docx模板是一种更简单的方法.
There is an easier way by using a fifth-level header block (#####
) and a docx template defined in YAML.
在Microsoft Word中创建headingfive.docx
后,选择Heading 5
的Modify Style
,然后在Line and Page Breaks
选项卡中选择Page break before
,然后保存headingfive.docx
文件.
After creating headingfive.docx
in Microsoft Word, you select Modify Style
of the Heading 5
, and then select Page break before
in the Line and Page Breaks
tab and save the headingfive.docx
file.
---
title: 'Making page break using fifth-level header block'
output:
word_document:
reference_docx: headingfive.docx
---
在Rmd
文档中,在YAML标头中定义reference_docx
,现在您可以使用分页符#####
.
In your Rmd
document, you define reference_docx
in the YAML header, and now you can use the page-breaking #####
.
请参阅下文.
https://www.r-bloggers.com/r-markdown-how-to-insert-page-breaks-in-a-ms-word-document/
这篇关于如何在RStudio& amp;生成的Word文档中添加分页符降价的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!