I'm looking for a way to span minipages
across pages in LaTeX.
I have a collection of recipes (presented through the recipe environment provided by the cuisine package) that varies in length, from something like 10 lines to more than can fit on a page. I want to fit as many as possible on one page and span the text across pages only if necessary.
Until now I used the minipage
environment that is sufficient if the content is not longer than a page.
Is there a way to get a "2 pages"-minipage
or something similar ?
EDIT:
I have something like : texts A, B, C and D. I don't want them to span across pages if not necessary.
- AAAABB (newpage) BBCCDD is not acceptable
- AAAA (newpage) BBBB (newpage) CCDD is the desirable output
EDIT:
My content is a collection of recipes from the cuisine package.
Best Answer
Your specification is too vague. You want to fit as many onto one page as possible, but some are larger than a single page so they should be split. What's the criterion for allowing a split? I'd do something like this:
Typeset the recipe in a box and measure it.
If it's shorter than some constant length (say 40% the height of the page), then put it in a minipage on the page.
If it's longer, insert it onto the page without using minipage (hence allowing it to split)
Here's code to do something like this: