13

I am working in report class. I would like to redefine \section so that it starts on a new page, except for the first section in every chapter.

It seems I should just put code from this answer Start new page with each section together with some conditional like \if not firstsection then... but I do not know how to do that properly.

Any help is very appreciated.

15

Here's one possible solution using the etoolbox package and a conditional :

\documentclass{report}
\usepackage{etoolbox}

\pretocmd{\section}{%
  \ifnum\value{section}=0 \else\clearpage\fi
}{}{}

\begin{document}

\chapter{First Chapter}
\section{Section One One}
\section{Section One Two}
\section{Section One Three}

\end{document}
  • 1
    might you want \clearpage instead? – cmhughes Mar 6 '12 at 22:16
  • @cmhughes: yes, if floats are involved, it could be safer; thanks. – Gonzalo Medina Mar 6 '12 at 22:20
  • \preto is simpler – egreg Mar 6 '12 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.