1

I would like to create a command/environment for my Beamer presentation that allows me to display blocks/list items/… step by step using <+-> and then, on the last slide, that hides all previously displayed blocks to show only a picture (or a text).

I'm currently doing this by hand, like that:

\documentclass{beamer}
\usepackage{graphicx}

\begin{document}

\begin{frame}
  \frametitle{My title}

  \begin{onlyenv}<-3>
    \begin{block}{Block 1}<+->
      Test 1
    \end{block}
    \begin{block}{Block 2}<+->
      Test 2
    \end{block}
    \begin{block}{Block 3}<+->
      Test 3
    \end{block}
  \end{onlyenv}

  \begin{onlyenv}<4->
    \includegraphics[width=\textwidth]{example-image-a}
  \end{onlyenv}
\end{frame}

\end{document}

However, this is not very practical, as I have to manually compute the slide number and change the value in two places each time I add a block.

I tried using \value{beamerpauses}, \insertframestartpage and \insertframeendpage, but without success.

Is there a way to create a generic command to hide all old overlays and displaying another content?

3
  • 2
    Why don't you just put the picture on a new frame with the same title?
    – user194703
    Oct 13, 2019 at 14:26
  • I thought about that by I'd lose the page numbering.
    – John Doe
    Oct 13, 2019 at 15:51
  • You could add \addtocounter{framenumber}{-1} before the extra frame to avoid this problem.
    – user194703
    Oct 13, 2019 at 19:39

1 Answer 1

1

You could simply use a new frame for your image. With the noframenumbering option, this frame will not influence your frame numbering.

\documentclass{beamer}

\begin{document}

\begin{frame}
  \frametitle{My title}

    \begin{block}{Block 1}<+->
      Test 1
    \end{block}
    \begin{block}{Block 2}<+->
      Test 2
    \end{block}
    \begin{block}{Block 3}<+->
      Test 3
    \end{block}
\end{frame}

\begin{frame}[noframenumbering]
  \frametitle{My title}
    \includegraphics[width=\textwidth]{example-image-a}
\end{frame}

\end{document}

You must log in to answer this question.

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