I'm using \setbox
and \usebox
to define a box, measure its default dimensions and render it later. During rendering, sometimes there is more vertical space available than measured initially, and I'd like to distribute this space between paragraphs. Is this possible using only the \mybox
box in the example below?
\documentclass{scrartcl}
\pagestyle{empty}
\newbox\mybox
\begin{document}
\setbox\mybox=\hbox{
\begin{minipage}[t]{10em}
\setlength{\parskip}{0ex plus5ex}
First paragraph
Second paragraph
Third paragraph
\end{minipage}
}%
%
\usebox{\mybox}
% How can I render the box with a specified height and distribute the paragraphs
% according to the parskip?
\end{document}
Updating glue after changing width of a box seems related, but I don't see how to apply the technique shown there to change the height of a box.
minipage
, you can if you say\setbox\mybox=\vbox{...}
and then do tricks with\unvbox
. – egreg Jun 23 '15 at 12:26\vbox
like a minipage (type in paragraphs separated by an empty line, specify the width of the box)? Then I could use\vbox
instead ofminipage
-- but isn't a minipage just a box (internally) that can be unboxed just the same? – krlmlr Jun 23 '15 at 12:34\@minipagerestore
at the start, so the behavior should be the same as in a minipage – egreg Jun 23 '15 at 12:43\setbox\mybox=\vbox{\@minipagerestore...}
(requires\makeatletter
). – egreg Jun 23 '15 at 12:51