Show slide content step by step in LaTeX (beamer: pause, only, uncover)
\pause hides everything that follows it in the frame until the next step. For finer control, many commands accept an overlay specification in angle brackets, such as \item<2-> or \only<1>{...}. beamer writes one PDF page per step.
The snippets use the document class beamer.
Reveal paragraphs one after another (pause)
Each \pause ends a step. The frame below becomes three PDF pages: the first shows one sentence, the second two, and the third all three.
\begin{frame}{Method}
First the sensor is calibrated.
\pause
Then the measurement starts.
\pause
Finally the data is exported.
\end{frame}Reveal list items
[<+->] after \begin{itemize} reveals one more item on every step. To set the steps yourself, write the specification after \item: <2-> means from step 2 on, <2> on step 2 only, <1-3> on steps 1 to 3, and <1,4> on steps 1 and 4.
\begin{frame}{Results}
\begin{itemize}[<+->]
\item The error is below 2 percent.
\item The sensor works down to minus 20 degrees.
\item Light rain does not change the result.
\end{itemize}
\end{frame}
\begin{frame}{Procedure}
\begin{itemize}
\item<1-> Calibrate the sensor.
\item<2> Wait until the display is stable.
\item<3-> Start the measurement.
\end{itemize}
\end{frame}Replace or uncover content (only, uncover, onslide)
\only<1>{...} typesets its content on the given steps and takes no space on the others; that fits content that replaces other content, such as two versions of a figure. \uncover<2->{...} reserves the space on every step, so the rest of the slide does not move. \onslide<3-> without braces applies to everything that follows, up to the next \onslide.
\begin{frame}{Comparison}
\only<1>{\includegraphics[width=4cm]{image-a.png}}%
\only<2->{\includegraphics[width=4cm]{image-b.png}}
\uncover<2->{The second image shows the signal after calibration.}
\onslide<3->
The difference is 0.2 m/s.
\end{frame}Highlight text on one step (alert)
Formatting commands accept the specification as well. \alert<2>{...} colours its text red on step 2 only, and \textbf<3>{...} is bold on step 3 only. The text itself is visible on every step.
\begin{frame}{Key figures}
\begin{itemize}
\item Range: \alert<2>{0 to 40 m/s}
\item Error: \textbf<3>{below 2 percent}
\item Power: \textcolor<4>{blue}{0.5 W}
\end{itemize}
\end{frame}Dim hidden content or print without steps
This line in the preamble shows content that is not uncovered yet in a pale colour and no longer hides it. It affects \pause, \uncover, \onslide and list items, but not \only. For a print version, add the class option handout: \documentclass[handout]{beamer} puts all steps of a frame on one page.
This goes into the preamble.
\setbeamercovered{transparent}Pitfalls
- The specification stands directly after the command name, before any other argument:
\includegraphics<2>[width=4cm]{image.png},\begin{block}<2->{Title}. - Inside
align,\pausehides nothing: every step shows all lines. Wrap the parts of the later lines in\uncover<2->{...}, one per cell. In atabular, a\pauseafter\\does reveal the table row by row. - All steps of a frame share one slide number. The number of PDF pages grows with the steps, the number of frames does not.
Compiled with pdfLaTeX from TeX Live 2023.