58

I'm creating a beamer presentation. I want to make one frame that has a couple of images overlapped, like a stack of photos. Actually, I want something like this:

.-----.
| AAA |
| AAA |
'-----'

Then, the next slide shows:

.-----.
| AAA |
| AA.-----.
'---| BBB |
    | BBB |
    '-----'

And then, the next one shows:

.-----.
| AAA |
| AA.-----.
'.-----.B |
 | CCC |B |
 | CCC |--'
 '-----'

The idea is to control the position of each image and allow them to overlap. I have no idea about how to do this in beamer.

I think the best solution is to have all images inside the same frame, but put a \pause command between them.

3 Answers 3

58

A TikZ example:

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

\begin{frame}
\begin{center}
\begin{tikzpicture}
  \node (img1) {\includegraphics[height=3cm]{img1}};
  \pause
  \node (img2) at (img1.south east) {\includegraphics[height=3cm]{img2}};
  \pause
  \node (img3) at (img2.south west) [yshift=1cm] {\includegraphics[height=3cm]{img3}};
\end{tikzpicture}
\end{center}
\end{frame}

\end{document}

enter image description here

The second and third images are placed on a corner of the previous image, the third also shifted a little upward, the reason being that with the images I used there was some whitespace between them. You could of course place the images at specific coordinates, and not relative to each other like here.

3
53

Can be done with the simple LaTeX command \put without any additional package. The units are in pt, but if you prefer other units then you can set it by for example: \unitlength=1cm. The values are always measured from the current point. In my example from the beginning of the line

\PassOptionsToPackage{demo}{graphicx}%% Only for demo here
\documentclass{beamer}
\def\Put(#1,#2)#3{\leavevmode\makebox(0,0){\put(#1,#2){#3}}}
\begin{document}

\begin{frame}
\includegraphics[height=3cm]{img1}\pause

\Put(10,50){\color{blue}\includegraphics[height=3cm]{img2}}\pause

\Put(100,30){\color{red}\includegraphics[height=3cm]{img3}}
\end{frame}

\end{document}

enter image description here

7
  • 5
    Those coordinates (10,50) and (100,30) are measured in what unit? Commented Nov 15, 2011 at 15:10
  • 2
    in pt, but if you prefer other units then you can set it by for example: \unitlength=1cm. The values are always measured from the current point. In my example from the beginning of the line
    – user2478
    Commented Nov 15, 2011 at 15:19
  • 2
    Herbert, thanks for providing a simple solution that avoids the mysterious complexity of tikz.
    – Mars
    Commented Nov 21, 2015 at 5:01
  • I tried to use this solution to put two images exactly one over the other. So I used two calls to "\Put(0,0)", but, the second image was pushed slightly to the right. I had to change the second call to "\Put(-9,0)" to aligh them. Commented Dec 1, 2016 at 10:12
  • 3
    I suppose that you had a trailing space. At the end of the first \put... you need a %
    – user2478
    Commented Dec 1, 2016 at 10:31
5

You can place all three images at absolute positions using the textpos package (see also Absolute positioning in beamer). A further method would be to use TikZ to place the three images in own coordinate system inside a tikzpicture. Both pacakges should work very well with beamer. The animation can be added using \pause or another overlay macro of beamer.

You must log in to answer this question.

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