8.1 ⁑Overlays
Overlays allow you to uncover parts of a slide. For example, to uncover
the items in the above itemize
environment:
\begin{frame} \frametitle{Mind-Controlling Cookies} \framesubtitle{Recipe} \begin{block}{Ingredients} \begin{itemize}[<+->] \item Self-raising flour; \item Butter; \item Chocolate chips; \item Sugar obtained from secret genetically modified beet. \end{itemize} \end{block} \end{frame}
This creates five slides. The first just has one item (Figure 8.5), the second has two items (Figure 8.6), etc.
This completely hides the text until it's uncovered. If you prefer to show the text faintly before it's uncovered, you can use:
\setbeamercovered{transparent}
This mixes 85% of the background colour with 15% of the text colour. Note that the effect varies according to the display device. Now the first slide of:
\begin{frame} \frametitle{Mind-Controlling Cookies} \framesubtitle{Recipe} \begin{block}{Ingredients} \begin{itemize}[<+->] \item Self-raising flour; \item Butter; \item Chocolate chips; \item Sugar obtained from secret genetically modified beet. \end{itemize} \end{block} \end{frame}
faintly shows the second item onwards (see Figure 8.7).
Alternatively, you can specify the overlay information for each item.
Example:
\begin{frame} \frametitle{Mind-Controlling Cookies} \framesubtitle{Recipe} \begin{block}{Ingredients} \begin{itemize} \item<1->Self-raising flour; \item<2->Butter; \item<1->Chocolate chips; \item<2->Sugar obtained from secret genetically modified beet. \end{itemize} \end{block} \end{frame}
This shows the first and third items on the first slide and all items
on the second slide. You can similarly apply overlays to
beamer environments, such as block
, or to
standard environments, such as enumerate
:
\begin{frame} \frametitle{Mind-Controlling Cookies} \framesubtitle{Recipe} \begin{block}{Ingredients} \begin{enumerate}[<+->] \item Self-raising flour; \item Butter; \item Chocolate chips; \item Sugar obtained from secret genetically modified beet. \end{enumerate} \end{block} \end{frame}
The general syntax of the overlay specification is <⟨start⟩-⟨end⟩>, where ⟨start⟩ is the starting index and ⟨end⟩ is the end index. Parts of the specification can be omitted. For example, <2-> means slide 2 onwards whereas <2> means only on slide 2. This specification can also be applied to some common commands, such as
For full syntax, see the beamer manual [103].
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-07-4).