I am writing a book and have already made contract for x pages with the printing company, so I want to create a PDF containing x pages. However, say that I only have material enough to fill x − y pages. Is there some package or simple hack available for adding y empty pages at the end of the document? I.e. I want to add empty pages until the latest added page is page number x.

  • You could add clearpage\null the appropriate number of times. (And add \pagestyle{empty} after the first \clearpage\null.) – lockstep Aug 6 '11 at 9:34

You can do this using a simple loop.

The following code will ensure the document to be e.g. 100 pages in size:







The memoir package provides the \leavespergathering{} command for a purpose closely related to yours. Ipsis literis from the manual:

The command \leavespergathering{num} ensures that there will be exactly the right number of pages output to make a complete set of gatherings of num leaves (2× num pages) each --- if necessary blank pages will be output at the end to make up the correct tally. If num is less than two (the default) then no additional pages will be output.

Thus, to fill to 84 pages, for example, you would use \leavespergathering{42}

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.