问题
I am using the RStudio, knitr, pandoc, MS Word combo to get my final results in a docx
document.
Occasionally, I would like the report to continue on a new page. I can't find the way to achieve this.
From what I have Googled, it seems to be possible with CSS
. I don't know HTML
or CSS
, but if it is the solution I will learn. Just don't want to take the wrong road...
回答1:
Try the LaTeX command \newpage. Pandoc recognizes it and might (not on a computer right now) translate it to a Word page break.
回答2:
```{=openxml}
<w:p>
</w:pPr>
<w:r>
<w:br w:type="page"/>
</w:r>
</w:p>
```
Insert this codes in the position of new page you wanted in the .RMD file, and knit the file to word file. It will be translated into a new page break by pandoc, just like a \newpage command using $Latex$.
来源:https://stackoverflow.com/questions/15937631/rstudio-knitr-pandoc-word-how-do-i-get-a-new-page-in-my-docx