# Beamer: vertically center picture inside overlayarea

Is there an easy way to vertically center a picture inside an overlayarea environment?

Here is a MWE of a small animation:

\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{columns}
\column{.45\columnwidth}
\begin{overlayarea}{\columnwidth}{.7\textheight}
\includegraphics<1>[width=\columnwidth,height=.7\textheight,keepaspectratio]{picture1}
\includegraphics<2>[width=\columnwidth,height=.2\textheight,keepaspectratio]{picture2}
\end{overlayarea}
\column{.45\columnwidth}
\begin{itemize}[<+->]
\item Point A
\item Point B
\end{itemize}
\end{columns}
\end{frame}

\end{document}


Picture1 and picture2 will appear on the top of the columns, instead of being vertically centered (in fact, it is the overlayarea that is vertically centered, and all the picture inside are visibly aligned on its top)

The command \vfill does not seem to work.

Currently, I can correct the alignment of picture by inserting this kind of code:

\only<2>{\vspace{.25\textheight}}


-

One possibility is to use a \parbox instead of overlayarea:

\PassOptionsToPackage{demo}{graphicx}
\documentclass{beamer}
\begin{document}

\begin{frame}
\begin{columns}
\column{.45\columnwidth}
\parbox[c][.7\textheight][c]{\columnwidth}{%
\includegraphics<1>[width=\columnwidth,%
height=.7\textheight,keepaspectratio]{image1}%
\includegraphics<2>[width=\columnwidth,%
height=.2\textheight,keepaspectratio]{image2}%
}
\column{.45\columnwidth}
\begin{itemize}[<+->]
\item Point A
\item Point B
\end{itemize}
\end{columns}
\end{frame}

\end{document}


The line \PassOptionsToPackage{demo}{graphicx} simply replaces actual figures with black rectangles; do not use that option in your actual document.

-
Interesting. So, what is the purpose of the overlayarea environment if a \parbox seems to do the same (or even a better) job? –  Lionel MANSUY Nov 21 '12 at 16:28
@LionelMANSUY quite frankly, I wouldn't know; in fact, overlayarea is defined using a \vbox of the given height and then a minipage of the given width using [t] for the optional argument so, in a sense, it's more general to use a minipage or a \parbox from scratch. –  Gonzalo Medina Nov 21 '12 at 17:50