Wandmalfarbe/pandoc-latex-template

How to set pagebreak for each Heading 1

mertbakir opened this issue · 2 comments

Is there a way to add \newpage for each Heading 1?

Regards.

For large documents I recommend using the option book: true together with chapter headings. Chapters automatically start on a new page so \newpage isn't necessary. Please see the readme on how to compile a book.

If you really want to have every top level heading on a new page without using book: true you can add the following two commands with header-includes.

---
title: "Example PDF"
author: [Author]
date: "2017-02-20"
subject: "Markdown"
keywords: [Markdown, Example]
lang: "en"
header-includes: |
    \usepackage{sectsty}
    \sectionfont{\clearpage}
...

# Vinaque sanguine metuenti cuiquam Alcyone fixus

Lorem markdownum Letoia, et alios: figurae flectentem annis aliquid Peneosque ab
esse, obstat gravitate. Obscura atque coniuge, per de coniunx, sibi **medias
commentaque virgine** anima tamen comitemque petis, sed. In Amphion vestros
hamos ire arceor mandere spicula, in licet aliquando.

# Aesculeae domus vincemur et Veneris adsuetus lapsum

Lorem markdownum Letoia, et alios: figurae flectentem annis aliquid Peneosque ab
esse, obstat gravitate. Obscura atque coniuge, per de coniunx, sibi **medias
commentaque virgine** anima tamen comitemque petis, sed. In Amphion vestros
hamos ire arceor mandere spicula, in licet aliquando.

The sectsty package conflicts with other packages. You are already using KOMO Script. A better solution is to add the following to your header-includes metadata:

\addtokomafont{section}{\clearpage}