0

I have successive slides where one column is text and the other column is just an image. The image stays the same, so I simply kept the exact same code in a new frame. However, at my surprise, when I vary the text of the left column, the vertical alignment of the picture in the right column changes. I would like the picture to stay still from a frame to another.

Here is a MWE which should make it clearer:

\documentclass{beamer}

\begin{document}

\begin{frame}
\begin{columns}

\column{0.5\textwidth}

Sample text

\column{0.5\textwidth}
\begin{figure}

\centering
\def\svgwidth{\textwidth}
\input{fig.pdf_tex}
\caption{Wobbly figure}

\end{figure}

\end{columns}
\end{frame}

\begin{frame}
\begin{columns}

\column{0.5\textwidth}

A much longer sample text which messes up with the vertical alignment of the image in the other column. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

\column{0.5\textwidth}
\begin{figure}

\centering
\def\svgwidth{\textwidth}
\input{fig.pdf_tex}
\caption{Wobbly figure}

\end{figure}

\end{columns}
\end{frame}

\end{document}

enter image description here enter image description here

  • \begin{colummns}[T]? – user121799 Dec 9 '18 at 4:39
  • I just tried but it does not work on my side. Does it work in general? – Olivier Massicot Dec 9 '18 at 5:35
  • 1
    It aligns both columns at the top. All you need to do is to move the figure a bit down if you don't want it at the top. – user121799 Dec 9 '18 at 5:41
  • 1
    Unrelated to your problem, but you cannot squeeze two columns of .5\textwidth besides each other, this leaves no room for the intercolumn space. Either make them a bit smaller (e.g. .48\textwidth) or use \begin{columns}[onlytextwidth] – user36296 Dec 9 '18 at 12:09
  • 1
    You also don't need \centering in your figure, figures are centred by default in beamer – user36296 Dec 9 '18 at 12:10
3

Yes, it does. Of course, one has to make the usual corrections and I do not have your figure.

\documentclass{beamer}

\begin{document}

\begin{frame}[t]
\begin{columns}[T]

\begin{column}{0.485\textwidth}

Sample text

\end{column}
\begin{column}{0.485\textwidth}
\vspace*{2cm}
\begin{figure}

\centering
\includegraphics[width=0.9\textwidth]{example-image-duck}
\caption{Wobbly figure}

\end{figure}
\end{column}
\end{columns}
\end{frame}

\begin{frame}[t]
\begin{columns}[T]

\begin{column}{0.485\textwidth}

A much longer sample text which messes up with the vertical alignment of the image in the other column. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
\end{column}
\begin{column}{0.485\textwidth}
\vspace*{2cm}
\begin{figure}

\centering
\includegraphics[width=0.9\textwidth]{example-image-duck}
\caption{Wobbly figure}
\end{figure}
\end{column}
\end{columns}
\end{frame}
\end{document}

enter image description here

  • It works now! I was not aware of the usual changes I guess, I had just put [T] after the columns beginning. – Olivier Massicot Dec 9 '18 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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