In my document, I have many large unbreakable boxes. Sometimes, the text will take up most of the page before a box that is a little too big to still fit. Consequently, I am often manually using \enlargethispage{\baselineskip}
and \clearpage
to adjust the page height for good page breaks. I know that I can use flexible lengths between boxes, and that would help if my boxes almost fill a page. But what if my boxes are a bit too long? Is there a way that I can tell TeX that the available page height can be stretched if it needs to?
The following illustrates what I'm having. The box is a bit too big to fit on the page. But if I shrink the bottom margin by only .1in, then the page is large enough to fit everything. I'd like to be able to specify a flexible length for the bottom margin, but the geometry package doesn't allow that to happen, and I'm not proficient enough with the page dimension lengths to be able to manually specify the appropriate spots.
\documentclass[letterpaper]{article}
\usepackage[margin=2in]{geometry} % document default causes two mostly empty pages
%\geometry{bottom=1.9in} % enlarging allows me to get one full page this time
%\geometry{bottom=2in plus 0in minus .1in}
% I'd like to keep the default, but allow it to stretch if necessary
% this command isn't valid - it acts like
%\geometry{bottom=2in}plus 0in minus .1in
\usepackage{lipsum}
\begin{document}
\lipsum[1-3]
\noindent
\fbox{\parbox[t][2in]{.97\textwidth}{large unbreakable box}}
\end{document}
There are a few other questions that deal with adjusting page dimensions and big unbreakable boxes, but the usual response ends up being that the user should manually adjust the layout. I'm wanting to find a way for TeX to automatically make the adjustments, so that I don't have to fiddle with every page. This question is close to what I'm asking about, but it's focusing on adjusting the box, not the height of the page. (And I don't understand the accepted answer.)