Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 14 down vote accepted

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}
share|improve this answer
    
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
    
That works very well for me. Thank you! –  rafaelm Mar 6 '12 at 23:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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