3

I usually have slides with constructs like the following:

\begin{frame}{A frame title}
What am I trying to do here?
\begin{enumerate}[<+->]
   \item Show some stuff
   \item Show more stuff incrementally
   \item ...?
   \item Profit!
\end{enumerate}

\only<+>{I'm just going to show this briefly}
\uncover<+->{...and then I'll replace it with this!}
\end{frame}

I'd like that to render five slides - the first showing only the question, and the first list item showing up first on the second slide.

I can do this by adding \addtocounter{beamerpauses}{1} at the top of the slide, but then I have to do this on every slide... I tried to hook into the frame template to do it, but it didn't have any effect. What's the best way to do this?

9
  • 2
    How about adding a \pause?
    – percusse
    Jun 28, 2014 at 20:11
  • @percusse That also has to be done on every slide plus it has to be located correctly.
    – cfr
    Jun 28, 2014 at 20:17
  • 2
    You could use [<+(1)->] instead of [<+->]. You still have to do it on every slide, though.
    – cfr
    Jun 28, 2014 at 20:18
  • 1
    @cfr Well you need to type \begin{frame} for each frame too. ;) Put it before the enumerate.
    – percusse
    Jun 28, 2014 at 20:21
  • Use @cfr's approach, but define a custom environment: \newenvironment{enumerateh}{\begin{enumerate}[<+(1)->]}{\end{enumerate}}
    – jub0bs
    Jun 28, 2014 at 20:23

2 Answers 2

3

Sounds like the only problem you have left is to execute \addtocounter{beamerpauses}{1} on every frame. This can be done by hooking it into the frameenv.

\documentclass{beamer}

\usepackage{etoolbox}

\makeatletter
\def\beamer@frameenv{%
  \def\beamer@process@envbody{\endgroup%
    \expandafter\expandafter\expandafter\beamer@framecommand\expandafter\beamer@frameoptions\expandafter{\the\beamer@envbody}}%
  \global\beamer@envbody{}\def\beamer@begin@stack{b}%
  \begingroup
  \let\frame\beamer@collect@@body
  \def\beamer@process@envbody{\frame}%
  \beamer@process@envbody%
  \addtocounter{beamerpauses}{1} %NEW
}
\makeatletter


\begin{document}
\begin{frame}{A frame title}
What am I trying to do here?
\begin{enumerate}[<+->]
   \item Show some stuff
   \item Show more stuff incrementally
   \item ...?
   \item Profit!
\end{enumerate}

\only<+>{I'm just going to show this briefly}
\uncover<+->{...and then I'll replace it with this!}
\end{frame}

\end{document}

enter image description here

3

I'd go with something like

\documentclass{beamer}
\begin{document}

\begin{frame}{A frame title}
What am I trying to do here?
\begin{enumerate}[<+(1)->]
   \item Show some stuff
   \item Show more stuff incrementally
   \item ...?
   \item Profit!
\end{enumerate}

\only<1>{I'm just going to show this briefly}
\uncover<2->{...and then I'll replace it with this!}
\end{frame}

\end{document}

Normally I'd avoid hard-coding slide numbers, but it seems by far the easiest approach here. (An alternative, if you know the number of slides, would be to use a relative offset.)

You must log in to answer this question.

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