0

To have text and images on the same slide, I use this kind of code:

\frametitle{My title}
\begin{tabular}{l}
\parbox{0.5\linewidth}{
\begin{itemize}
\onslide<2->{\item Item 1}
\onslide<3->{\item Item 2}
\end{itemize}}
\end{tabular}
\begin{tabular}{c}
\only<2>{\includegraphics[height=3cm]{Image1}}
\only<3>{\includegraphics[height=3cm]{Image2}}
\end{tabular}

I'm pretty happy with the output, except for this small detail: even if Image1 and Image2 are the same dimensions in pixels, Image2 is slightly shifted to the right compared to Image1. Any idea how to fix this ?

nicoco
  • 326
  • Damn, as soon as I posted this, I found a solution: no linebreak between the two \only and the problem is solved. Sorry guys – nicoco Feb 23 '16 at 13:24
  • Or just a comment % character after the \onlys – campa Feb 23 '16 at 13:26
  • I'm voting to close this question as off-topic because the authors find a solution – Romain Picot Feb 23 '16 at 13:37
  • 3
    @RomainPicot Why should it be closed? It is a valid question and probably helpful for other LaTeX beginners. I think it should be answered properly with a short explanation why this happens and a link to http://tex.stackexchange.com/questions/7453/what-is-the-use-of-percent-signs-at-the-end-of-lines – Benjamin Feb 23 '16 at 13:46
  • The original poster can always delete it if he wants to. – John Kormylo Feb 23 '16 at 16:58
  • The "% at the end of the line solution" is perfect, thanks ! – nicoco Feb 24 '16 at 15:26

0 Answers0