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?
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?
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}
titlesec one
– Johannes_B
Mar 19 '15 at 15:24
\documentclass{...}and ending with\end{document}. – Mar 19 '15 at 15:11\newpagewill not make two page breaks: a\newpageat top of the page is ignored, but it is better to define\sectionto include the page break (as\chapteris normally defined) rather than putting\newpagebefore each section by hand – David Carlisle Mar 19 '15 at 15:12