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

后端 未结 10 2194
情深已故
情深已故 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条回答
  •  -上瘾入骨i
    2020-12-03 02:59

    You can use the R package worded. This avoids the need for a template word file. See https://github.com/davidgohel/worded.

    The output parameter needs to be set to worded::rdocx_document and you need to call library(worded).

    ---
    date: "2018-03-27"
    author: "David Gohel"
    title: "Document title"
    output: 
      worded::rdocx_document
    ---
    
    ```{r setup, include=FALSE}
    library(worded)
    ```
    

    You can then add to your document whenever you want a page break.

    The package allows various word formatting options using a similar mechanism.

提交回复
热议问题