# Page break after each section with title

I'd like to have there be a page break in between each section, just like in this question, but I'd also like there to be no page break prior to the first section (that is, between the title and the first section). I'm currently using that question's best answer's suggestion:

\let\stdsection\section
\renewcommand\section{\clearpage\stdsection}


but I can obviously change.

• if there is text between the title and the first \section, do you still want no page break before the first \section? – barbara beeton Sep 17 '14 at 14:49

Instead of \clearpage add a command that, the first time, redefines itself to be the same as \clearpage:

\let\latexsection\section
\renewcommand{\section}{\sectionbreak\latexsection}
\newcommand{\sectionbreak}{\global\let\sectionbreak\clearpage}

• Are you Sauron? – joshlf Sep 17 '14 at 19:15
• @synful No, I only practice TeX wizardry, which is surely white magic. ;-) – egreg Sep 17 '14 at 20:07
• *which is whitespace magic – joshlf Sep 17 '14 at 21:58

This version resembles the version of egreg, but it regards the (total) section number, such, that there is no pagebreak just before the first section occurs (unless manually forced)

\documentclass[12pt]{article}

\usepackage{etoolbox}%
\usepackage{blindtext}%
\usepackage{assoccnt}%

\let\LaTeXStandardSection\section
\newcounter{totalsection}%

\DeclareAssociatedCounters{section}{totalsection}

\renewcommand{\section}{%
\ifnumequal{\number\value{totalsection}}{0}{%
}{%
\clearpage%
}%
\LaTeXStandardSection
}%

\begin{document}

\tableofcontents

\section{First -- with no pagebreak}
\section{Second with pagebreak}%

\end{document}