[Tex/LaTex] Start new page with each section

page-breakingsectioningsections-paragraphstitlesec

I would like to start each section on a new page. Is adding the following to my preamble this the preferred method, or a hack?

\let\stdsection\section
\renewcommand\section{\newpage\stdsection}

Best Answer

With an uptodate TeX distribution you can use

\AddToHook{cmd/section/before}{\clearpage}

Example:

\documentclass{article}
\AddToHook{cmd/section/before}{\clearpage}
\begin{document}
\tableofcontents
Text
\section{Title}
Text
\subsection{Title}
Text
\subsection{Title}
Text
\section{Title}
Text
\end{document}