RStudio, knitr, pandoc, Word: how do I get a 'new page' in my docx?

廉价感情. 提交于 2019-12-06 20:37:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!