Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
2  
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
add comment

4 Answers

up vote 15 down vote accepted

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}
share|improve this answer
    
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
3  
I guess it's \beamer@frametextheight in beamerbaseframe.sty. –  Stefan Kottwitz Aug 17 '10 at 1:19
3  
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
add comment

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]
share|improve this answer
add comment

I had similar problem and according to this beamer guide:

http://www.math.umbc.edu/~rouben/beamer/quickstart-Z-H-18.html#node_sec_18

it is enough to start columns environment command by [T] options,

\begin{columns}[T]

Works fine for me.

share|improve this answer
    
This forces same alignment for all columns, not individually. –  LWZ Sep 6 '13 at 18:48
add comment

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.