top alignment of a figure in beamer columns not working

I have the problem that the figure is differently placed regarding the top space in dependance on whether I put it into a column or not.

What I try to achive is that the figure starts at the same heights in a column as without it.

So basically I thing the T option for columns does not do the job here but I do not know why...

Here is a minimal example (replace the figure with an existing one):

\documentclass[final,t]{beamer}

\begin{document}

\begin{frame}
begin{columns}[T,onlytextwidth]
\centering
\begin{column}{0.48\textwidth}
\begin{figure}
\includegraphics[scale=1]{image.pdf}
\caption{aha}
\end{figure}
\end{column}
\begin{column}{0.48\textwidth}
test
\end{column}
\end{columns}
\end{frame}

\begin{frame}
\begin{figure}
\includegraphics[scale=1]{image.pdf}
\caption{aha}
\end{figure}
\end{frame}

\end{document}


Thanks.

The difference in height is caused by the figure environment which adds some vertical space around the figure. As a workaround you could use the \captionof command from the caption package instead.

\documentclass[final,t]{beamer}
\usepackage{caption}

\begin{document}

\begin{frame}
\begin{columns}[T,onlytextwidth]
%    \centering
\begin{column}{0.48\textwidth}
%       \begin{figure}
\centering
\includegraphics[scale=0.5]{example-image-duck}
%          \caption{aha}
%       \end{figure}
\end{column}
\begin{column}{0.48\textwidth}
test
\end{column}
\end{columns}
\end{frame}

\begin{frame}
\begin{figure}
\includegraphics[scale=0.5]{example-image-duck}
\caption{aha}
\end{figure}
\end{frame}

\end{document}


• Thank you. This is a nice workaround. However, I still do not undersand how column envirnment affects the space the figure environment is adding. Because the top space is different with and without columns while it is a figure environment all the time... – Satas Jan 8 at 18:54
• I am not trying to have exactly the same height as the text on the other side but the same space from the top for figures placed in columns or directly in the frame. – Satas Jan 8 at 18:56
• @Satas If the figure is at the top of the page, the space above the figure gets skipped, this does not happen inside columns. – user36296 Jan 8 at 19:42
• And there is no option to skip it inside columns as well? – Satas Jan 8 at 19:58
• @Satas Why? The figure environment doesn't do much more than centring the image. Leaving it out is the simplest solution. – user36296 Jan 8 at 20:00