# Why won't my minipage keep the height with \resizebox?

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

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

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}

• 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. What output do you want? perhaps add \vspace{0pt} as the first thing in each minipage, so they all align on that? – David Carlisle Mar 22 '17 at 14:14
• That works! Please feel free to make it into an answer! – Kristian Nordestgaard Mar 22 '17 at 19:40

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.