1

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:

Desired result

For images of different size:

enter image description here


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}

1 Answer 1

0

Inspired by this post, I found a solution.


Code

\documentclass[aspectratio=169]{beamer}

\usepackage[export]{adjustbox}

\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}

Result

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .