r markdown content page

I am trying to create a content page in R Markdown in PDF file. I have the below code in YAML header. When knitting as PF file. The content page isn't been created for some reason. What am i missing in here please?Also, What is the best method to add site URL into my bib file. Is there a format i need to use? Many Thanks

output:
  pdf_document:
  toc: true
  theme: united
  number_sections: true
  html_document: default
  word_document: default
bibliography: bibliography.bib

You need to indent properly:

output:
  pdf_document:
    toc: true
    theme: united
    number_sections: true
    html_document: default
    word_document: default
bibliography: bibliography.bib
2 Likes

YAML indentation issues are hard to debug

output:
  pdf_document:
    toc: true
    theme: united
    number_sections: true
  html_document: default
  word_document: default
bibliography: bibliography.bib
3 Likes

Ah yes, I edited too quickly.

Thanks for your help both. I had to fix the indentation and remove the theme as was causing an error message. Is there are away to have the content page on a separarte page please?

What do you mean by that ? Having a page break after the content page ?

The content page is showing below the title page. I would like a content page to show on the first page. Can you add a page break in the YAML section? Thanks

You can add page break you \newpage or some html tag but I am not sure to see where you want to put it.

Do you have a example of what rendering you have in mind ?
A small rmarkdown reprex would help. thanks.

Depending on where you want it to be, you'll have to modify template or include a header.

Thanks! I have the content page and the title page on the same page now. Can you have the title page on s separate page? Also, i am using section_number which shows the numbering as 0.1 - 0.2 can i change this to 1.0 and so on. It's difficult to produce a reprex of this.

title: 
author: 
date: "3 January 2019"
output:
  pdf_document:
    toc: true
    toc_depth: 4
    number_sections: 2
  html_document: default
  word_document: default
bibliography: bibliography.bib

I think this should be true not a number and

you need to use H1 header (#) and not begin with H2 header (##)

1 Like

Thanks! This worked fine. Is there away to have the content page on a separete page. At the moment it shows below the title page?