# Stable vertical alignment of columns in Beamer

In Beamer, I often use a two-column slide layout, picture on the left and text on the right. Sometimes the same picture is used on multiple slides, with the text on the right changing. I use the Beamer columns environment for this purpose.

My problem is that typically the pictures in the two slides do not have the same vertical alignment, causing a slightly annoying "jiggle". None of the various options for column seems to help, and the default (align centers) is the most reasonable anyway.

Is there a way to force the picture to be vertically centered with respect to the page, irrespective of the size of the content of the other column?

Here's an example - the text on the left (representing a picture) moves a little between frames.

\documentclass{beamer}
\usepackage{calc}
\begin{document}
\begin{frame}\frametitle{Test frame}
\begin{columns}
\column{.5\textwidth}
A figure
\column{.5\textwidth}
\begin{itemize}
\item Item 1
\item Item 2
\end{itemize}
\end{columns}
\end{frame}
\begin{frame}\frametitle{Test frame 2}
\begin{columns}
\column{.5\textwidth}
A figure
\column{.5\textwidth}
\begin{itemize}
\item Another item 1
\item Another item 2
\item This list is longer
\item Than the previous one
\item was
\end{itemize}
\end{columns}
\end{frame}
\end{document}

-
Complete source code of an example that demonstrates the problem? –  Jukka Suomela Aug 16 '10 at 23:26
Good idea, done. –  Neil Olver Aug 16 '10 at 23:54

You could fix the vertical alignment by using minipages of the same height in the second column. Here's the modified example with a stable left column:

\documentclass{beamer}
\usepackage{calc}
\begin{document}
\begin{frame}\frametitle{Test frame}
\begin{columns}
\column{.5\textwidth}
A figure
\column{.5\textwidth}
\begin{minipage}[c][.6\textheight][c]{\linewidth}
\begin{itemize}
\item Item 1
\item Item 2
\end{itemize}
\end{minipage}
\end{columns}
\end{frame}
\begin{frame}\frametitle{Test frame 2}
\begin{columns}
\column{.5\textwidth}
A figure
\column{.5\textwidth}
\begin{minipage}[c][.6\textheight][c]{\linewidth}
\begin{itemize}
\item Another item 1
\item Another item 2
\item This list is longer
\item Than the previous one
\item was
\end{itemize}
\end{minipage}
\end{columns}
\end{frame}
\end{document}

-
Thanks, that works perfectly! –  Neil Olver Aug 17 '10 at 0:34
Actually, one more question. Rather than .6\textheight, I'd like to use a value which is always large enough (so that I can use this in a macro). It seems that textheight is too large; does Beamer have a variable that stores the height of the text area of the slide? –  Neil Olver Aug 17 '10 at 0:43
I guess it's \beamer@frametextheight in beamerbaseframe.sty. –  Stefan Kottwitz Aug 17 '10 at 1:19
Thanks! For the benefit of those not used to @ (which is special), you can use the following sequence to define a \frametextheight, which you can then use in place of .6\textheight in the above. \makeatletter\let\frametextheight\beamer@frametextheight\makeatother –  Neil Olver Aug 17 '10 at 2:00

I had similar problem and found out that it is enough to start the columns environment command by [T] options,

\begin{columns}[T]


Works fine for me.

-
This forces same alignment for all columns, not individually. –  LWZ Sep 6 '13 at 18:48

I think this is a good candidate for the overprint environment. It typesets different material on different slides, but puts them all inside a box the size of the largest one.

\documentclass{beamer}
\usepackage{calc}
\begin{document}
\begin{frame}
\frametitle<1>{Test frame}
\frametitle<2>{Test frame 2}
\begin{columns}
\column{.5\textwidth}
A figure
\column{.5\textwidth}
\begin{overprint}
\onslide<1>
\begin{itemize}
\item Item 1
\item Item 2
\end{itemize}
\onslide<2>
\begin{itemize}
\item Another item 1
\item Another item 2
\item This list is longer
\item Than the previous one
\item was
\end{itemize}
\end{overprint}
\end{columns}
\end{frame}
\end{document}


EDIT: although, I just realized that this makes both lists be top-aligned, so the shorter one may look a bit displaced. I'm not sure if there's a way to specify that the contents of overprint should be vertically centered.

-
Thanks for the suggestion. For various reasons I prefer to keep the frames separate, but that's interesting that you can use overlays with frametitle, I didn't know that! –  Neil Olver Aug 17 '10 at 0:36

It is also possible to center contents of columns vertically with the [c] options. It works fine for me. Maybe this helps also to solve your problem.

\begin{columns}[c]

-