2

I am trying to make a presentation with the beamer package. One of the slides requires me to have an image change with every new line of text I open.

I do this by splitting the slide in columns with column environment, putting the text in an item environment in the left column, and... trying out various things for the images.

My current slides are using \only<x>{ .. }, and I am aware this is most likely the problem. But, I've tried tips from all the similar questions (this, this, this, this), but using \onslide (with or without overlay or overprint environment) jams all the images together and does not transition through them at all.

I've checked that my images are of the completely same size (it's 3-steps-of-a-process, the same image with new elements in each step), but they still keep changing position. The latex code I am using right now:

\begin{frame}
\frametitle{Title}
  \begin{columns}
    \begin{column}{.6\textwidth}
      \begin{itemize}
        \item<1-> \emph{Important text}
        \item<2-> Very important process
            \begin{itemize}
                    \item<3-> Steps one and two
                    \item<5-> Step with no image
            \end{itemize}
      \end{itemize}
    \end{column}
    \begin{column}{.4\textwidth}
    \vspace{0cm}
        \begin{figure}[h]
        \only<2>{ \includegraphics[scale = 0.6]{img/proc0.png} }
        \only<3>{ \includegraphics[scale = 0.6]{img/proc1.png} }
        \only<4>{ \includegraphics[scale = 0.6]{img/proc2.png} }
        \end{figure}
    \end{column}
  \end{columns}
\end{frame}

My taughts were that the figure environment might reserve the space that \only<x> does not... and it helped a little but not all the way. Without the figure environment, proc1.png is displayed a little to the right of proc0.png, and proc2.png is displayed a little more to the right. With the figure environment, proc1.png is again displayed a bit more to the right than proc0.png, but then proc2.png is displayed in the same place.

I've tried all the combinations I have found on Google and here that made sense to me. Currently, I ran out of inspiration for what else to try so I would appreciate any help from the community.

Here are the images I am using (if you guys think they are too big to be in a post, I will just change it into a link, but for now..):

Image1 Image2 Image3

5
  • 2
    You don't need to add figure around \includegraphics. It works fine on its own as long you don't want a caption. Commented May 21, 2012 at 9:08
  • @MartinScharrer I just tried removing the figure environment to re-check. There is a difference, I edited my post and now there is a passage under the latex-code explaining the different behaviors with/without figure
    – penelope
    Commented May 21, 2012 at 9:40
  • I didn't meant removing figure would solve it, just that it is not required in this case anyway. Commented May 21, 2012 at 9:52
  • Please also check Dancing images in beamer. Commented May 21, 2012 at 9:54
  • @MartinScharrer I did check and try out that link, that's where I got the \vspace{0cm} from. I just couldn't find all the questions I checked while I was writing the question. Also, since with the figure environment I got a bit more desirable results than without it, it was in my last-used latex-code that I posted.
    – penelope
    Commented May 21, 2012 at 10:02

1 Answer 1

4

The following works for me:

\documentclass{beamer}
\usepackage{graphicx}
\begin{document}

\begin{frame}{Title}
  \begin{columns}
    \begin{column}{.6\textwidth}
      \begin{itemize}
        \item<1-> \emph{Important text}
        \item<2-> Very important process
            \begin{itemize}
                    \item<3-> Steps one and two
                    \item<5-> Step with no image
            \end{itemize}
      \end{itemize}
    \end{column}
    \begin{column}{.4\textwidth}
        \begin{overlayarea}{0.38\textwidth}{4cm}
        \includegraphics<2>[scale = 0.6]{proc0.png}%
        \includegraphics<3>[scale = 0.6]{proc1.png}%
        \includegraphics<4>[scale = 0.6]{proc2.png}%
        \end{overlayarea}
    \end{column}
  \end{columns}
\end{frame}

\end{document}
5
  • I would use \includegraphics<2>[scale = 0.6]{proc0.png} etc. instead. The problem might be spurious spaces after the }. Adding % there might also be a good idea. Commented May 21, 2012 at 9:53
  • @MartinScharrer Indeed I was just copy/pasting from the OP's code. Let me fix that
    – percusse
    Commented May 21, 2012 at 9:54
  • @percusse sorry for being a newbie, what does % do exactly? otherwise, works perfectly :) great
    – penelope
    Commented May 21, 2012 at 10:03
  • 1
    @penelope No problem. It is the commenting out character and TeX ignores anything that comes after that on the same line. This makes sure that there is no accidental horizontal space typeset.
    – percusse
    Commented May 21, 2012 at 10:08
  • @percusse. I knew about the comment character, just not about how it could be used in the same way. Could you maybe edit than in the answer as a short explanation, so we don't pollute the comment section? I think it's relevant and useful...
    – penelope
    Commented May 21, 2012 at 10:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .