Text moves in Latex Beamer presentation when content in different column changes

I am struggeling with a Latex Beamer presentation.

What I want:

In the attached example I have a frame with two columns. In the left column I added a list of items, in the right column I show a picture. When I klick a key I want to show a second picture with the same size, it should replace the first image without changing the position. If the first and second picture are the same (like in the example) no change should be visible.

What I get:

The second picture, which is the same as the first in this example, moves and also the text in the left column moves, eventhough it should from my understanding not be affected by a change because it is in another column.

Example:

\documentclass{beamer}
\usetheme{CambridgeUS}

\begin{document}

\begin{frame}
\frametitle{Example}

\begin{columns}
\column[c]{.5\textwidth}
\begin{itemize}
\item This is an interesting fact
\item this one is even more interesting
\end{itemize}

\column[c]{.5\textwidth}
\only<1>{\includegraphics[width=\textwidth]{example-image-a}}
\only<2>{\includegraphics[width=\textwidth]{example-image-a}}

\end{columns}
\end{frame}
\end{document}


You are missing % at the end of line. Without them the line break will be interpreted as space.

\documentclass{beamer}
\usetheme{CambridgeUS}

\begin{document}

\begin{frame}
\frametitle{Example}

\begin{columns}
\begin{column}[c]{.5\textwidth}
\begin{itemize}
\item This is an interesting fact
\item this one is even more interesting
\end{itemize}
\end{column}
\begin{column}[c]{.5\textwidth}
\includegraphics<1>[width=\textwidth]{example-image-a}%
\includegraphics<2>[width=\textwidth]{example-image-a}%
\end{column}
\end{columns}
\end{frame}
\end{document}

• Thanks a lot, this solved my problem! You also changed \column[]{} to \begin[column}[]{}, has this any advantage? – plus Jun 15 '20 at 15:15
• @plus The change to \begin{column}...\end{column} is mostly just a personal preference because I find it easier to see where each column stops. Unrelated to your problem, but two columns of .5\textwidth are too big and will protrude into the margin. I suggest to either make them a bit smaller or use \begin{columns}[onlytextwidth] – samcarter_is_at_topanswers.xyz Jun 15 '20 at 15:18