Search code examples
emacslatexorg-mode

Org-mode export to Latex: page break at each section and subsection


I want the pdf document to always have a page break at a section and subsection. I could add

#+latex: \clearpage

before each heading and sub-heading on org-mode. However, I think it makes my org document kind of confusing and visually dirty.

Is there a way to do it all at once, i.e., to force a page break so that all sections and subsections begin always on a new page?

I'd be glad if anyone help me.


Solution

  • Try this:

    #+LATEX_HEADER: \let\oldsection\section
    #+LATEX_HEADER: \renewcommand{\section}{\clearpage\oldsection}
    #+LATEX_HEADER: \let\oldsubsection\subsection
    #+LATEX_HEADER: \renewcommand{\subsection}{\clearpage\oldsubsection}