1

I am just trying to insert different images of the same side in the same slide, so it gives the effect of just the image changing while the rest of the slide remains the same, including slide number.

For that I use \includegraphics<1>, \includegraphics<2>, \includegraphics<3>, etc.

I am including the images inside a \fbox, and it is leaving an undesired horizontal space that I do not know how to get rid of.

See my MWE:

\documentclass{beamer}

\begin{document}

\begin{frame}
    \fbox{\includegraphics[width=.5\linewidth]{example-image-a}}\\
    \vspace*{4pt}
    \fbox{\includegraphics<1>[width=.5\linewidth]{example-image-a}
        \includegraphics<2>[width=.5\linewidth]{example-image-b}
        \includegraphics<3>[width=.5\linewidth]{example-image-c}}
\end{frame}

\end{document}

which produces:

test

Notice the spacing in the images below, how to get rid of it? Thanks!

2

To get rid of the extra white space, you can add a % sign as shown in the following example:

\documentclass{beamer}

\begin{document}

\begin{frame}
    \fbox{\includegraphics[width=.5\linewidth]{example-image-a}}\\
    \vspace*{4pt}
    \fbox{\includegraphics<1>[width=.5\linewidth]{example-image-a}%
        \includegraphics<2>[width=.5\linewidth]{example-image-b}%
        \includegraphics<3>[width=.5\linewidth]{example-image-c}}
\end{frame}

\end{document}

enter image description here

More detailed information on the usage of % at the end of lines can be found here: What is the use of percent signs (%) at the end of lines?

2

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.