Thank you very much, John, that works perfectly!

On Fri, 4 Oct 2019 at 12:48, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:

One approach is outlined here:
https://tex.stackexchange.com/questions/153444/insert-newpage-before-section-but-prevent-pagebreak-after-part

Create a file sectionbreaks.tex containing the following:

%%%%
\usepackage{etoolbox}
\newtoggle{afterpart}
\pretocmd{\section}
  {\iftoggle{afterpart}
    {\global\togglefalse{afterpart}}% we're after a part
    {\clearpage}% we're not immediately after a part
  }{}{}
\pretocmd{\part}
  {\clearpage % do a page break
   \global\toggletrue{afterpart}% tell \section we're just after a part
  }
  {}{}\usepackage{etoolbox}
%%%%

Then call pandoc with -H sectionsbreaks.tex -o whatever.pdf


Gabriel Volpe <volpegabriel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Is there anything like --epub-chapter-level but for PDF outputs?
>
> I really like how I can set up the level in which to split the different
> pages and I would love if I could do the same for PDF.
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/996131ba-41a3-4aca-b181-72ebe3c9bb4b%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAJReL35Vptkx%3DzQd-tb_4wGXPLXPSR2%3D7gDdBEZGT7qNxPkENA%40mail.gmail.com.