# Beamer: Multiple blocks with images - vertical centering of rows

I have a slide with multiple blocks, each in a seperate column. Each block should contain two images on top of each other. In my use case these are tikzpictures, but here I just use includegraphics.

I want to make sure that these images are vertically centered, like in a matrix. This works great in case you can make sure, that all images have the same size. But I have no idea how to center images of different size vertically between seperate blocks.

Are there ideas?

Also, how to make sure that the blocks have the same height? I tried using a minipage, as suggested here, but that leads to some unexpected effects with my tikzpictures.

## Image

For images of the same size:

For images of different size:

## MWE

\documentclass[aspectratio=169]{beamer}

\usetheme{Copenhagen}

\begin{document}

\begin{frame}[t]{Frametitle}
\begin{columns}[t]
\begin{column}{0.333\linewidth}
\begin{block}{Block1}
\centering
\includegraphics[width=\linewidth,height=0.33\textheight,keepaspectratio]{example-image-a}\\
\includegraphics[width=\linewidth,height=0.33\textheight,keepaspectratio]{example-image-b}
\end{block}
\end{column}
\begin{column}{0.333\linewidth}
\begin{block}{Block2}
\centering
\includegraphics[width=\linewidth,height=0.33\textheight,keepaspectratio]{example-image-c}\\
\includegraphics[width=\linewidth,height=0.33\textheight,keepaspectratio]{example-image-a}
\end{block}
\end{column}
\begin{column}{0.333\linewidth}
\begin{block}{Block3}
\centering
\includegraphics[width=\linewidth,height=0.33\textheight,keepaspectratio]{example-image-b}\\
\includegraphics[width=\linewidth,height=0.33\textheight,keepaspectratio]{example-image-c}
\end{block}
\end{column}
\end{columns}

\end{frame}

\end{document}


Inspired by this post, I found a solution.

## Code

\documentclass[aspectratio=169]{beamer}

\usetheme{Copenhagen}

\begin{document}

\begin{frame}[t]{Frametitle}
\begin{columns}[t]
\begin{column}{0.333\linewidth}
\begin{block}{Block1}
\parbox[c][.33\textheight][c]{\columnwidth}{%
\centering
\includegraphics[width=\linewidth,height=0.33\textheight,keepaspectratio]{example-image-a}
}
\parbox[c][.33\textheight][c]{\columnwidth}{%
\centering
\includegraphics[width=\linewidth,height=0.33\textheight,keepaspectratio]{example-image-b}
}
\end{block}
\end{column}
\begin{column}{0.333\linewidth}
\begin{block}{Block2}
%\centering
\parbox[c][.33\textheight][c]{\columnwidth}{%
\centering%
\includegraphics[width=\linewidth,height=0.25\textheight,keepaspectratio]{example-image-c}%
}
\parbox[c][.33\textheight][c]{\columnwidth}{%
\centering%
\includegraphics[width=\linewidth,height=0.25\textheight,keepaspectratio]{example-image-a}%
}
\end{block}
\end{column}
\begin{column}{0.333\linewidth}
\begin{block}{Block3}
\parbox[c][.33\textheight][c]{\columnwidth}{%
\centering%
\includegraphics[width=\linewidth,height=0.33\textheight,keepaspectratio]{example-image-b}%
}
\parbox[c][.33\textheight][c]{\columnwidth}{%
\centering%
\includegraphics[width=\linewidth,height=0.33\textheight,keepaspectratio]{example-image-c}%
}
\end{block}
\end{column}
\end{columns}

\end{frame}

\end{document}