LaTeX beamer package and growing figures

I'm using beamer package in LaTeX to build my slides. I saw in some final examples in LaTeX (I mean, I saw the PDF format and not the tex format), that contains an image that is being build along several slides. For example:

On slide1:

>

On slide2:

->

On slide3:

-->

On slide4:

--->


Please imagine this picture as an arrow growing.

In this case, I'm building an arrow, but what I really like is having a state diagram appearing along the slides.

Is it possible to build this?

2 - If I have the state diagram as an PDF file, and I import the PDF file to the LaTeX, can I put the feature explained on 1) in the imported file?

-

migrated from stackoverflow.comApr 4 '11 at 12:46

This question came from our site for professional and enthusiast programmers.

I guess not automatic. What I do (and I know others, who handle it same way) is using some overlay environment (like overprint) oder multiple frames and just use different picture files, which show the desired image in its different states.

If you got a .pdf I would recommend inkscape. Use your picture as final picture, then copy the file to file-1.pdf file-2.pdf ... Afterwards open the -X files with inkscape, remove the different contents (Attention: dont change here the cropping!) you dont want on the earlier slides and save them again as pdfs. Aftwerwards include all images in the correct order and voila, you got your growing picture.

-

In beamer, the \includegraphics command understands overlay specifications, so you can do things like

\begin{frame}
\includegraphics<1>[height=2cm]{step1.pdf}%
\includegraphics<2>[height=2cm]{step2.pdf}%
\includegraphics<3>[height=2cm]{step3.pdf}%
\end{frame}


(taken from the Graphics section in the beamer user manual).

That will include the file step1.pdf on the first slide, replace it with step2.pdf on the second slide, etc. You can also have all the steps in one pdf file, say steps.pdf, as individual pages, and include them as

\begin{frame}
\includegraphics<1>[height=2cm,page=1]{steps.pdf}%
\includegraphics<2>[height=2cm,page=2]{steps.pdf}%
\includegraphics<3>[height=2cm,page=3]{steps.pdf}%
\end{frame}


I usually use the Ipe graphics editor to create multi-page pdf files that can be used like this, because its concept of layers and views is especially well suited for this.

Another possibility is to create your graphics directly in LaTeX using the tikz package. There are examples of using tikz to incrementally build pictures for beamer presentations.

-

I know this is an old question, but I just found this in the Beamer user manual:

...some programs, like xfig, sometimes also produce series of graphics in which each file just contains the additional graphic elements to be shown on the next slide. In this case, the first graphic must be shown not on overlay 1, but from overlay 1 on, and so on. While this is easy to achieve by changing the overlay specification <1> to <1->, the graphics must also be shown on top of each other. An easy way to achieve this is to use TeX’s \llap command like this:

\begin{frame}
\frametitle{The Three Process Stages}

\includegraphics<1->{first.pdf}%
\llap{\includegraphics<2->{second.pdf}}%
\llap{\includegraphics<3->{third.pdf}}
\end{frame}


or like this:

\begin{frame}
\frametitle{The Three Process Stages}

\includegraphics{first.pdf}%
\pause%
\llap{\includegraphics{second.pdf}}%
\pause%
\llap{\includegraphics{third.pdf}}
\end{frame}


A more convenient way is to use the \multiinclude command, see Section 14.1.3 for details.

-