[Tex/LaTex] Why won’t the minipage keep the height with \resizebox

minipageresize

I have three minipages next to each other. They all work as expected, with the top alignment I ask for:

Minipages

However, when I change the contents of the first minipage to {\resizebox{1cm}{!}{foo}}, things go wrong (red box added for clarity):

Minipages

How can I remedy this? Here's the MWE:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{minipage}[t][5cm][t]{34.5pt}{\resizebox{1cm}{!}{foo}}
\end{minipage}
%
\begin{minipage}[t][5cm][t]{187pt}bar\\bar\\bar
\end{minipage}
\begin{minipage}[t][5cm][t]{34.5pt}bat\\bat\\bat
%
\end{minipage}
\end{document}

Best Answer

t means the alignment is on the baseline of the first row, which is what your image shows: the baseline of foo matches that of the first bar.

You could add \vspace{0pt} as the first thing in each minipage, so they all align on that.