1

I want my \section is always in a new page, so I need a \newpage before \section.

What about the current page is new page already? How do I avoid it?

Rankaba
  • 11
  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Mar 19 '15 at 15:11
  • two \newpage will not make two page breaks: a \newpage at top of the page is ignored, but it is better to define \section to include the page break (as \chapter is normally defined) rather than putting \newpage before each section by hand – David Carlisle Mar 19 '15 at 15:12

1 Answers1

2

Something like this? Prepending the \section code with a \clearpage should do.

\documentclass{article}

\usepackage{blindtext}

\usepackage{xpatch}

\xpretocmd{\section}{\clearpage}{}{}

\begin{document}
\tableofcontents

\section{First}
\blindtext[5]

\section{Second}
\blindtext[20]

\section{Gandalf}
\blindtext[10]


\end{document}