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?