10

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?

8

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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.