How to add a page break in word document generated by RStudio & markdown

后端 未结 10 2218
情深已故
情深已故 2020-12-03 02:33

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

10条回答
  •  天涯浪人
    2020-12-03 03:09

    Sungpil's article was close, but didn't quite work. This was the best solution I found for this: https://scriptsandstatistics.wordpress.com/2015/12/18/rmarkdown-how-to-inserts-page-breaks-in-a-ms-word-document/

    Even better, the author included the Word template to make this work. The R-blogger's link to his template is broken, and the header is formatted wrong. Some notes I took:

    1) You might need to include the whole path to the word template in your Rmd header, like so:

    output: 
        word_document:
          reference_docx: C:/workspace/myproject/mystyles.docx
    

    2) The template at the link above changed some of the default style settings so you'll need to change them back

提交回复
热议问题