我有一个用于演示的“图形”目录,我使用多个叠加层来开发和解释它。在稍后的演讲中,我想再次引用它。为此,我需要“调用”目录切片,但不调用所有介绍性叠加层。
梅威瑟:我希望以下幻灯片的叠加层 1-3 出现在演讲的开头,然后是其他一些幻灯片,然后是叠加层 4,然后是其他一些幻灯片,然后是叠加层 5。
\documentclass[beamer]{standalone}
\usepackage{tikz}
\makeatletter
\newcommand*{\overlaynumber}{\number\beamer@slideinframe}
\makeatother
\begin{document}
\begin{standaloneframe}{Contents}
\begin{tikzpicture}
\node at (5,0) {overlay: \overlaynumber};
\node (a) at (0,0) {A};
\node (b) at (1,0) {B};
\node (c) at (2,0) {C};
\pause % -------------------------------------
\draw [->] (a) -- (b);
\draw [->] (b) -- (c);
\pause %--------------------------------------
\visible<+>{
\node at (0.5,1) {some explanation};
}
% --------------------------------------------
\visible<+>{
\draw [red]
(a.south west) rectangle (b.north east);
}
% --------------------------------------------
\visible<+>{
\draw [red]
(a.south west) rectangle (b.north east);
}
% --------------------------------------------
\visible<+>{
\draw [red]
(b.south west) rectangle (c.north east);
}
\end{tikzpicture}
\end{standaloneframe}
\end{document}
答案1
您\againframe<>{}
可以选择要重复的覆盖。
\documentclass{beamer}
\usepackage{tikz}
\makeatletter
\newcommand*{\overlaynumber}{\number\beamer@slideinframe}
\makeatother
\begin{document}
\begin{frame}<1-3>[label=foo]{Contents}
\begin{tikzpicture}
\node at (5,0) {overlay: \overlaynumber};
\node (a) at (0,0) {A};
\node (b) at (1,0) {B};
\node (c) at (2,0) {C};
\pause % -------------------------------------
\draw [->] (a) -- (b);
\draw [->] (b) -- (c);
\pause %--------------------------------------
\visible<+>{
\node at (0.5,1) {some explanation};
}
% --------------------------------------------
\visible<+>{
\draw [red]
(a.south west) rectangle (b.north east);
}
% --------------------------------------------
\visible<+>{
\draw [red]
(a.south west) rectangle (b.north east);
}
% --------------------------------------------
\visible<+>{
\draw [red]
(b.south west) rectangle (c.north east);
}
\end{tikzpicture}
\end{frame}
\begin{frame}
other frame
\end{frame}
\againframe<4>{foo}
\begin{frame}
yet other frame
\end{frame}
\end{document}
使用最新版本的 Beamer,可以简化为
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}<1-3>[label=foo]{Contents}
\begin{tikzpicture}
\node at (5,0) {overlay: \insertoverlaynumber};
\node (a) at (0,0) {A};
\node (b) at (1,0) {B};
\node (c) at (2,0) {C};
\pause % -------------------------------------
\draw [->] (a) -- (b);
\draw [->] (b) -- (c);
\pause %--------------------------------------
\visible<+>{
\node at (0.5,1) {some explanation};
}
% --------------------------------------------
\visible<+>{
\draw [red]
(a.south west) rectangle (b.north east);
}
% --------------------------------------------
\visible<+>{
\draw [red]
(a.south west) rectangle (b.north east);
}
% --------------------------------------------
\visible<+>{
\draw [red]
(b.south west) rectangle (c.north east);
}
\end{tikzpicture}
\end{frame}
\begin{frame}
other frame
\end{frame}
\againframe<4>{foo}
\begin{frame}
yet other frame
\end{frame}
\end{document}