48

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.

46

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.

46

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

  • 1
    Those coordinates (10,50) and (100,30) are measured in what unit? – Denilson Sá Maia Nov 15 '11 at 15:10
  • 1
    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 Nov 15 '11 at 15:19
  • 2
    Herbert, thanks for providing a simple solution that avoids the mysterious complexity of tikz. – Mars Nov 21 '15 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. – Erel Segal-Halevi Dec 1 '16 at 10:12
  • 1
    I suppose that you had a trailing space. At the end of the first \put... you need a % – user2478 Dec 1 '16 at 10:31
4

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.