Beamer:如何说服“includeslide”包含框架的最后一张幻灯片

Beamer:如何说服“includeslide”包含框架的最后一张幻灯片

我用它\includeslide来创建 Beamer 演示文稿幻灯片的副本,但遇到了一个小问题。默认情况下,它似乎选择第一的除非我使用选项或后缀指定页码,否则请在框架中滑动:

% assume 4 slides in the frame
\includeslide{mylabel}  % this shows the first slide
\includeslide{mylabel<4>} % this shows the fourth slide

现在,我的演示文稿非常大,因此我使用了很多新命令和环境来加快速度。有什么方法可以让我默认\includeslide使用最后的幻灯片放在框架中?例如,是否有包含幻灯片数量的 Beamer 变量,或者 pgfimage 选项,我能否以某种方式侵入 includeslide 的新版本?

答案1

当我开始使用 Beamer 做演示时,我总是忘记一帧的结束时间,因此我会在不了解当前帧的所有内容是否都显示完的情况下提前跳到下一帧。(当然,现在我会打印出讲义版本并放在我面前。)所以我想出了一个技巧,可以在标题显示时修改它。最后的帧给我一个视觉线索,表明它是最后一帧。这可能适合您的需求(尽管可能有更好的解决方案),因为它使用计数器来跟踪最后一帧的编号。它并不完全可靠,因为如果帧在编译之间发生彻底的大小变化(在这种情况下,请删除辅助文件),它可能会感到困惑。

这是我用来测试系统的“实验”文件。它还允许定义“偏移”。

\documentclass[12pt,color=dvipsnames]{beamer}

\newcounter{last}
\newcounter{lastoffset}[framenumber]
\setcounter{last}{1}
\setcounter{lastoffset}{0}

\newcommand{\last}{%
\setcounter{last}{1}%
\addtocounter{last}{\insertframeendpage}%
\addtocounter{last}{-\insertframestartpage}%
\addtocounter{last}{\value{lastoffset}}%
}

\newcommand{\lastlabel}[1]{%
\last%
\label<\value{last}>{#1}%
}

\definecolor{last}{named}{purple}

\newcommand{\lastframetitle}[1]{%
\last%
\frametitle{\color<\value{last}| trans:0>{last}#1}
}

% Either: \reset redefines \last
% Or: just redefine the \lastframetitle and \lastlabel to the originals.

\newcommand{\reset}{%
\renewcommand{\last}{%
\setcounter{last}{1}%
}}

\begin{document}

\begin{frame}
\setcounter{lastoffset}{-1}
\lastframetitle{Example Frame}
\lastlabel{ex}

\arabic{lastoffset}

\hyperlink{ex}{\beamergotobutton{Last Slide}}

This is an example frame.
\pause

Wait here    
\pause

Paws for Thought

\onslide    
Visible all along?    
\end{frame}    

\begin{frame}
\lastframetitle{Second Frame}

\arabic{lastoffset}

This is the second frame.    
\pause

Another slide appears    
\pause

Yet more appear
\pause

Wait until the end    
\onslide

Should be here any time soon    
\pause

What's going on?    
\onslide

When do all these appear?    
\pause

Phew, that's all folks.
\end{frame}    

\end{document}

答案2

可以使用三个主要文件来实现解决方案:

  • main.beamer.tex 带有\documentclass{beamer}
  • main.handout.tex 和\documentclass[handout]{beamer}
  • main.article.tex 和\documentclass{article}

在 main.handout.pdf 中,每个框架只有最后一张幻灯片。通过将其包含\setjobnamebeamerversion{main.handout}到 main.article.tex 中,每个\includeslide{<label>}幻灯片都会生成所引用框架最后一张幻灯片的图片。

相关内容