[Tex/LaTex] Adding page breaks to pandoc latex template when converting markdown

conversionmarkdownpage-breakingpandoctemplates

Perhaps I'm missing something, but is there a way to either

(a) ensure that pandoc places pagebreaks before level 1 and level 2 headers in markdown (#,##), or

(b) hide \newpage from other markdown tools?

Is it possible to edit the template that pandoc uses for the conversion in order to do (a)?

Any ideas gratefully received.

🙂

Best Answer

pandoc --chapters, or pandoc -V documentclass=memoir or pandoc -V documentclass=book will tell pandoc to treat level 1 headers as chapters rather than sections. In both the book and memoir document classes, chapters are preceded by page breaks.

I'm not sure exactly what you need to set in your header to get page breaks before sections. Have you read the documentation for the memoir class? It includes a \setbeforesectionskip{} command that might a place to start.