SteveMcManaman
SteveMcManaman

Reputation: 433

How to force rmarkdown pdf output to start the table of contents in a new page?

I would like to have a page break before the table of contents when knitting. Right now it displays the table of contents right after the title (first) page, which is not aesthetically pleasing.

Upvotes: 1

Views: 1929

Answers (1)

manro
manro

Reputation: 3677

The most easiest solution for you - changing documentclass to report (table of contents will be on the second page).

---
title: "test"

header-includes: 
 \usepackage{geometry}
 \geometry{top=0.75in,left=3in,bottom=0.75in,right=0.80in}

output:
  pdf_document:
    toc: true
    number_sections: true
documentclass: report   
---

\chapter{First}

\chapter{Second}

Upvotes: 1

Related Questions