4.1 Insert page breaks
When you want to break a page, you can insert the command \newpage
in the document. It is a LaTeX command, but the rmarkdown package is able to recognize it for both LaTeX output formats and a few non-LaTeX output formats including HTML,5 Word, and ODT. For example:
---
title: Breaking pages
output:
pdf_document: default
word_document: default
html_document: default
odt_document: default
---
# The first section
\newpage
# The second section
This feature is based on Pandoc’s Lua filters (see Section 4.20). For those who are interested in the technology, you may view this package vignette:
vignette("lua-filters", package = "rmarkdown")
- For HTML output, page breaks only make sense when you print the HTML page, otherwise you will not see the page breaks, because an HTML page is just a single continuous page.↩︎
当前内容版权归 Chapman & Hall/CRC 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Chapman & Hall/CRC .