Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (5.3k points)
edited by

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 anyone 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

---

1 Answer

0 votes
by
edited by

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

Your code

\newpage

```{r, echo=FALSE}

Your code

```

\pagebreak

```{r, echo=FALSE}

Your code

```

For HTML knitting, you can use the following:

<P style="page-break-before: always">

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...