Is there a way to set a parbox to a minimum height?
\documentclass{article}
\begin{document}
\sbox{0}{\parbox{.5\textwidth}{one two three}}
\ifdim\dimexpr\ht0+\dp0<3cm
\dp0\dimexpr3cm-\ht0\fi
\fbox{\usebox{0}}
\end{document}
This is a bummer:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\tikz\node[draw,minimum height=3cm,text width=0.5\textwidth,inner sep=1pt] {one two three\\four five six};
\end{document}
An alternative solution with tcolorbox
package. For unbreakable boxes it's possible to define a height from=height1 to height2
where height1
defines the minimum height to be applied. If text doesn't fill the box it has height1
but if the text is longer, the box uses the needed space.
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\newtcolorbox{mybox}[1][]{%
sharp corners, height from=3cm to 20cm, #1
}
\begin{document}
\begin{mybox}
This is a short text
\end{mybox}
\begin{mybox}
\lipsum[1]
\end{mybox}
\end{document}