How to add \newpage in Rmarkdown in a smart way?

604    Asked by OliverWatson in Data Science , Asked on Jul 14, 2021

: 

 I wonder if one could simply use LaTeX newpage command in R markdown v2 in a different way than this:

```{r, results='asis', echo=FALSE}
cat("\newpage")
```

I produce pdf_output. If any1 has any idea please do not hesitate to comment :) ! Thanks

I create a pdf like this:

---
title: " "
author: " "
date: "2014"
output: 
   pdf_document:
      includes:
         in_header: naglowek.tex
      highlight: pygments
      toc: true
      toc_depth: 3
      number_sections: true
      keep_tex: true
---
How rmarkdown new page?
Answered by bhagwati dubey

To add a new page in rmarkdown for knitting a pdf file, you can use the
ewpage or pagebreak as follows:

Your code


ewpage

```{r, echo=FALSE}

Your code

```

pagebreak

```{r, echo=FALSE}

Your code

```

For HTML knitting, you can use the following:




Your Answer

Interviews

Parent Categories