3

I want to create a frame with text the reveals itself one item at a time, with a picture at the bottom which changes when new text is revealed. I did the following naive attempt:

\documentclass{beamer}

\begin{document}
\begin{frame}{title}

  \begin{itemize}
    \item text 1
    \pause
    \item text 2
  \end{itemize}

  \includegraphics<1>[height=40mm]{pic1.jpg}

  \includegraphics<2>[height=40mm]{pic2.jpg}

\end{frame}
\end{document}

However, this failed; pic1 is not displayed.

I guess the problem is that the includegraphics for pic1 comes after the pause, but how can I place it before the pause and still ensure it will be at the same place as pic2?

Another solution is not to use pause at all, but the alternative I see is using numbers for all the items in the slide, which will be very cumbersome in slides with many items.

3 Answers 3

6

(see below for my first answer)

Edit: A more complete and customizable solution (using columns to put images on the left or on the right).

enter image description here

\documentclass{beamer}
\usepackage{tikz}
\usepackage{calc}
\usepackage{lipsum}

% put a node on absolute position on the page
% (two compilations is necessary to get a good placement)
% #1: anchor of the page
% #2: shift vector
% #3: anchor of the node
% #4: minimum height of the node
% #5: minimum width of the node
% #6: content
\newcommand\absoluteput[6]{%
  \begin{tikzpicture}[overlay,remember picture]
    \path (current page.#1) ++ (#2)
    node[#3,minimum height=#4,minimum width=#5]{#6};
  \end{tikzpicture}%
}
% put a node 5mm above the south of the page
% #1: min height
% #2: content
\newcommand\putbottom[2]{\absoluteput{south}{0,5mm}{above}{#1}{0}{#2}}
% put a node 5mm to the left of the east of the page
% #1: min width
% #2: content
\newcommand\putright[2]{\absoluteput{east}{-5mm,0}{left}{0}{#1}{#2}}

% put a node 5mm to the right of the west of the page
% #1: min width
% #2: content
\newcommand\putleft[2]{\absoluteput{west}{5mm,0}{right}{0}{#1}{#2}}

\begin{document}

\begin{frame}{Frame with images at bottom}
  \begin{itemize}[<+->]
  \item Pellentesque interdum sapien sed nulla.
    \putbottom{42mm}{\includegraphics<.>[height=40mm]{example-image}}
  \item Proin tincidunt.
    \putbottom{42mm}{\includegraphics<.>[height=30mm]{example-image-a}}
  \item Aliquam volutpat est vel massa.
    \putbottom{42mm}{\includegraphics<.>[height=20mm]{example-image}}
  \item Sed dolor lacus, imperdiet non, ornare non, commodo eu,
    neque. Integer pretium semper justo.
    \putbottom{42mm}{\includegraphics<.>[height=42mm]{example-image-a}}
  \end{itemize}
  \vfill
  \vspace*{47mm} % 5mm (margin) + 42mm (max height of images)
\end{frame}

\begin{frame}{Frame with images on the right}
  \begin{columns}

    \column{\linewidth-5mm-47mm} % \linewidth - (margin) - (max width of images)

    \begin{itemize}[<+->]
    \item Pellentesque interdum sapien sed nulla.
      \putright{47mm}{\includegraphics<.>[width=40mm]{example-image}}
    \item Proin tincidunt.
      \putright{47mm}{\includegraphics<.>[width=30mm]{example-image-a}}
    \item Aliquam volutpat est vel massa.
      \putright{47mm}{\includegraphics<.>[width=20mm]{example-image}}
    \item Sed dolor lacus, imperdiet non, ornare non, commodo eu,
      neque. Integer pretium semper justo.
      \putright{47mm}{\includegraphics<.>[width=47mm]{example-image-a}}
    \item Proin tincidunt.
      \putright{47mm}{\includegraphics<.>[width=30mm]{example-image-a}}
    \item Aliquam volutpat est vel massa.
      \putright{47mm}{\includegraphics<.>[width=20mm]{example-image}}
    \item Sed dolor lacus, imperdiet non, ornare non, commodo eu,
      neque. Integer pretium semper justo.
      \putright{47mm}{\includegraphics<.>[width=42mm]{example-image-a}}
    \end{itemize}

    \column{47mm} % (max width of images)

  \end{columns}
\end{frame}

\begin{frame}{Frame with images on the left}
  \begin{columns}

    \column{30mm} % (max width of images)

    \column{\linewidth-5mm-30mm} % \linewidth - (margin) - (max xidth of images)

    \begin{itemize}[<+->]
    \item Pellentesque interdum sapien sed nulla.
      \putleft{30mm}{\includegraphics<.>[angle=90,width=30mm]{example-image}}
    \item Proin tincidunt.
      \putleft{30mm}{\includegraphics<.>[width=30mm]{example-image-a}}
    \item Aliquam volutpat est vel massa.
      \putleft{30mm}{\includegraphics<.>[width=20mm]{example-image}}
    \item Sed dolor lacus, imperdiet non, ornare non, commodo eu,
      neque. Integer pretium semper justo.
      \putleft{30mm}{\includegraphics<.>[width=30mm]{example-image-a}}
    \item Proin tincidunt.
      \putleft{30mm}{\includegraphics<.>[width=30mm]{example-image-a}}
    \item Aliquam volutpat est vel massa.
      \putleft{30mm}{\includegraphics<.>[width=30mm]{example-image}}
    \item Sed dolor lacus, imperdiet non, ornare non, commodo eu,
      neque. Integer pretium semper justo.
      \putleft{30mm}{\includegraphics<.>[width=16mm]{example-image-a}}
    \end{itemize}

  \end{columns}
\end{frame}
\end{document}

First answer:

You can use TikZ to add a picture at absolute place and you can use the option <+-> with itemize to use incremental overlay specifications. I add calls to vfill and \vspace... to keep space for the images.

You can make

enter image description here

Here, the code:

\documentclass{beamer}
\usepackage{tikz}

% put a node 5mm above the bottom of the page
% (two compilations required to get a good placement)
\newcommand\myabsoluteplace[1]{%
  \begin{tikzpicture}[overlay,remember picture]
    \node[anchor=south] at ([yshift=5mm]current page.south) {#1};
  \end{tikzpicture}%
}

\begin{document}
\begin{frame}{title}
  \begin{itemize}[<+->]
  \item text 1 \myabsoluteplace{\includegraphics<.>[height=40mm]{example-image}}
  \item text 2  \myabsoluteplace{\includegraphics<.>[height=30mm]{example-image-a}}
  \item text 3 \myabsoluteplace{\includegraphics<.>[height=20mm]{example-image}}
  \item text 4  \myabsoluteplace{\includegraphics<.>[height=42mm]{example-image-a}}
  \end{itemize}
  \vfill
  \vspace*{47mm} % 5mm (margin) + 42mm (max images)
\end{frame}
\end{document}
1
  • Wow, this looks fantastic.
    – Gadi A
    Sep 9, 2012 at 14:08
5

If I have correctly understood what you are trying to do, I think the following should work

\documentclass{beamer}
\usepackage{graphicx}
\setkeys{Gin}{draft}

\begin{document}

\begin{frame}{title}

  \begin{itemize}
    \item<1-> text1
    \item<2> text2
  \end{itemize}

\includegraphics<1>[height=40mm]{pic1.jpg}
\includegraphics<2>[height=40mm]{pic2.jpg}

\end{frame}

\end{document}

As you mention, it means providing the overlay specification for each \item, but there can't be so many of them on the same slide (especially with images on the same slide), right?

2

A weaker answer than Paul's, but one that doesn't require tikz, is the following, where the figures are foo-1.pdf, foo-2.pdf, foo-3.pdf, and so on.

\documentclass[11pt]{beamer}
\usepackage{xmpmulti}
\usepackage{graphicx}
\begin{document}
\begin{frame}
  \begin{columns}[h]
    \column{3in}
    \begin{itemize}[<+->]
    \item one
    \item two
    \item three
    \end{itemize}
\column{3in}
\begin{figure}
  \centering
  \multiinclude[<+>][format=pdf,start=1]{foo}
\end{figure}
  \end{columns}
\end{frame}
\end{document}

You must log in to answer this question.

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