为 beamerframe 键定义 beamer 帧叠加规范

为 beamerframe 键定义 beamer 帧叠加规范

我如何定义一个 beamer overlay 规范,beamer:0比如beamerframe key

\documentclass{beamer}

\makeatletter
\define@key{beamerframe}{hide}[true]{%

    %<--- definition of the beamer:0 switch??
}
\makeatother

\begin{document}

\begin{frame}[hide] %<-- has now overlay specification beamer:0

example text

\end{frame}

\end{document}

提前谢谢!

答案1

\documentclass{beamer}

\usepackage{xpatch}

\makeatletter
\newif\ifbeamer@hide
\define@key{beamerframe}{hide}[true]{\beamer@hidetrue}
\BeforeBeginEnvironment{frame}{\beamer@hidefalse}
\xpatchcmd{\beamer@@@@frame}{%
  \gdef\beamer@whichframes{#1}%
}{
  \ifbeamer@hide
    \gdef\beamer@whichframes{beamer:0}%
  \else
    \gdef\beamer@whichframes{#1}%
  \fi
}{}{}
\makeatother

\begin{document}

\begin{frame}
content...
\end{frame}

\begin{frame}[hide] %<-- has now overlay specification beamer:0

example text

\end{frame}



\begin{frame}
content...s
\end{frame}

\end{document}

相关内容