I prepare a book of short stories. There are no too long texts, each story takes no more than two pages. The customer asks to layout two-paged stories in such a way that they would be placed starting from an even page.

Now I've written a command that layouts a box of the title of a story and a box of full text of the story. The if their total height is greater than the height of the page, the current page number is checked and a page is skipped if necessary. Afterwards, the material is put: for the title its box is used, but the text is made up again.

In this scheme, the text is made up twice: at first, when I compute the height it takes, and at second, when it actually prepared for layout. Is it possible to optimize the process somehow?


You can check the value of the page number, and add blank pages as needed.

enter image description here



  \clearpage% Move to next page
  \ifodd\value{page} \mbox{}\clearpage\fi% If page is odd, move to next page
  \section*{#1}% Set story title/heading


\storytitle{First story}

\storytitle{Second story}

\storytitle{Third story}

\storytitle{Last story}

  • Would it not be better to use either \clearpage or \cleardoublepage in the if? – Oleg Lobachev Dec 17 '17 at 20:13
  • @OlegLobachev: If you're using the twoside option, then the pages will be cleared to an odd page. So you'll have to do some work correcting for that either way. – Werner Dec 17 '17 at 20:27

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.