5

Simple markdown file, with YAML block:

---
title: Report 
author: Tom Brown 12345678
date: August 2018
toc: true
numbersections: true
geometry: margin=2.5cm
urlcolor: blue
header-includes: |
    \usepackage{fancyhdr}
    \pagestyle{fancy}
    \lfoot{Draft Prepared: 15 August 2018}
    \rfoot{Page \thepage}
---

When I create the PDF output, the title and ToC are on the same page. How can I get the title block on one page and the ToC on the next? I've searched high and low and cannot find a solution.

Kurt Pfeifle
  • 13,079
Rob
  • 51

3 Answers3

5

Pandoc allows to insert LaTeX between title and the actual document via the include-before metadata field. Adding the following to your YAML header should be sufficient:

include-before:
- '`\newpage{}`{=latex}'
tarleb
  • 456
3

While @tarleb's method of course is correct and more 'YAMLish' (but less intuitive), you can also write the following into your source Markdown file:

---
title: Report 
author: Tom Brown 12345678
date: August 2018
toc: true
numbersections: true
geometry: margin=2.5cm
urlcolor: blue
header-includes: |
    \usepackage{fancyhdr}
    \pagestyle{fancy}
    \lfoot{Draft Prepared: 15 August 2018}
    \rfoot{Page \thepage}
---

\newpage{}

# First Headline

Here comes my markdown text ....
Kurt Pfeifle
  • 13,079
0

In the reference word document, modify the style for the Table of Contents as follows:

  1. Select TOC
  2. Selects "styles"
  3. Under the styles, select "Modify"
  4. Under modify style, select "Format"
  5. From the format, select "Paragraph"
  6. Within Paragraph "Line and Page Breaks" section, check/select "Page break before"
  7. Click Ok and save the reference document (word_styles.docx) and mention the same in Yaml.

---
output:
word_document:
reference_docx: "word_styles.docx"
---