I have sections which have to start exactly at the predefined page numbers and the potentially unfilled pages between these sections should be filled with empty pages. Is there a for-loop available that would insert \newpage
until the right page where the new section starts is reached?
1 Answer
Without any package, you can do with \loop
; the trick is to add something invisible to the empty pages, for instance \null
(more efficient than \mbox{}
):
\documentclass{article}
\newcommand{\filluptopage}[1]{%
\clearpage
\loop\ifnum\value{page}<#1\relax
\null\clearpage
\repeat
}
\begin{document}
Page 1 has text.
\filluptopage{5}
This will be at page 5.
\end{document}