So, I've seen this, but I need sections to start on a new page only after the first one
And I've been trying many different methods, and I was thinking that I could make an if statement somewhere that if the section number exceeds 2, it'll begin adding a \clearpage
. But I need this if statement to run with each new section that gets created, in theory
My major attempt at this was to do it inside my already-exsiting \titleformat
command, since I thought that it'll run the if
with each new section, and it looked something like this:
\newcommand{\sectionbreak}{} % create it empty at first to modify later
\titleformat{\section}
{\large\bfseries}
{\thesection}
{0pt}
{
\ifnum\value{section} > 1
{\renewcommand{\sectionbreak}{\clearpage}}
\else{\renewcommand{\sectionbreak}{}}
\fi
}
{}
I thought it'll run the if
after each section, because, in another document, I have another \ifnum
statement similar to this one that makes a \hspace
smaller in the separator, if the section number is larger than 10
But, this doesn't work, and I don't know what else to try. So, any solutions? This is going to be something used in both a book
, and also in an article
documentclass. So, class isn't very relevant
Best Answer
Just define
\sectionbreak
properly: