使 beamer 覆盖开始隐藏

使 beamer  覆盖开始隐藏

我的幻灯片通常包含以下结构:

\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}

我希望这样呈现幻灯片 - 第一页仅显示问题,第一项列表项首先显示在第二滑动。

我可以通过\addtocounter{beamerpauses}{1}在幻灯片顶部添加来实现这一点,但之后我必须在每张幻灯片上都这样做……我尝试挂接到框架模板来执行此操作,但没有任何效果。最好的方法是什么?

答案1

听起来你剩下的唯一问题就是\addtocounter{beamerpauses}{1}在每一帧上执行。这可以通过将其挂接到 来完成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}

在此处输入图片描述

答案2

我会选择类似

\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}

通常我会避免对幻灯片编号进行硬编码,但这似乎是目前为止最简单的方法。(如果您知道幻灯片的数量,另一种方法是使用相对偏移。)

相关内容