# Including a PDF with white background as transparent

I actually have two related questions.

1. I have a PDF I want to use with includegraphics in a beamer presentation. This PDF has a white background, which I want to be considered as transparent (so other items in the frame are printed above it. Is that possible?

2. It is actually more than a single PDF that I want to include, to create animation (each PDF is a frame). Right now I create frames separately. Is there a way to use all PDFs for animation?

I tried something like:

 \includegraphics{\alt<1>{img1}{\alt<2>{img2}{img3}}}}


to get animation, but it does not work.

-
have a look at the animate package - it allows you to specify a series of pdf images which are then played. you simply include it, e.g.\documentclass{article} \usepackage{animate} \documentclass{article} \usepackage{animate} \begin{document} \centerline{ \animategraphics[controls,buttonsize=10pt, width=10cm]{4}{cv}{2}{101}} \end{document} –  prettygully Feb 4 '12 at 20:44
Please don't mix several questions into one. –  Martin Schröder Jul 23 '12 at 7:47

Regarding 1: I do not know if and how this is possible, would be happy to learn about it. I guess the transparency has to be already in the PDF.

Regarding 2: This can be done using \foreach from the TikZ/PGF package and and \includegraphics<+>. I usually put all frames of an animation as pages into a single PDF, so I can write:

\usepackage{pgffor} % if you do not already include tikz

\begin{frame}{Animation}
\foreach \p in {1,...,10}{%
\includegraphics<+>[page=\p, width=\textwidth]{animation.pdf}
}
\end{frame}


If you do not have a single PDF, but a number of PDF files you might use pdftk to concatenate them. Alternatively, the following should work as well (I am not able to test this right now):

\usepackage{pgffor} % if you do not already include tikz

\begin{frame}{Animation}
\foreach \f in {frame1.pdf, frame2.pdf, frame3.pdf}{%
\includegraphics<+>[width=\textwidth]{\f}
}
\end{frame}


A very nice thing property of this approach is that it becomes pretty easy to specify a different sequence (usually one containing fewer slides) for the handout version.

-
1. For as far as I know it is not possible to make LaTeX ignore the background, however if you open the PDF in Inkscape the background is usually just one element which is easy to remove (though you do have to do this separately for each frame).

2. You can use the animate package then use:

\animategraphics{framerate}{basetitle}{start}{end}


For example if you want to play an animation at 10 fps, for which the frames are in frame001.png up to frame050.png which are located in the folder anim/, that would be:

\animategraphics{10}{anim/frame}{001}{050}


You may also want to use some options (for example autoplay or step), for details I would direct you to the package documentation on http://www.tug.org/texlive/Contents/live/texmf-dist/doc/latex/animate/animate.pdf.

I should point out that using the animate package may have some side effects when using anything else than Acrobat reader, in particular I find that background images tend to go all white in most PDF readers.

-
Welcome to TeX.sx! –  Kurt Oct 15 '12 at 15:50