始终*在标题幻灯片后插入固定幻灯片

始终*在标题幻灯片后插入固定幻灯片

我正在实施我所在机构的 PP 模板——就像许多其他人一样。在我们的组织中,我们经常展示机密内容,我们应该在幻灯片中加入有关分类的信息,并提醒人们将电子设备带出房间。

理想情况下,用户不必自己记住包含此幻灯片:如果 Beamer 被告知演示文稿包含机密信息,则它应该自动将此幻灯片插入标题页之后。现在,我们假设存在一个布尔值classified

作为一种解决方法,我可以将其作为标题页模板上的过渡。但是,打印时看起来会很奇怪。

感觉这个问题与标题页脚注不同的主题(原则上,在之前和之后插入一些东西应该是等​​价的?),但我还无法继续。

没有 MWE,因为我甚至不知道从哪里开始。因此,我很高兴能得到正确方向的指引,我一定会在最后发布一个可行的结果。

答案1

您可以将标题页和条件“分类”框架放在样式文件中。可以使用包AfterEndPreamble中的钩子插入框架etoolbox,该钩子在命令结束时执行\begin{document}

先生iooci.sty

\usepackage{etoolbox}
\newif\ifclassified
\classifiedtrue   % set boolean to true by default
\institute{Institute of Often Classified Information}   % default institute and logo
\logo{\fbox{\Huge IoOCI}}
\AfterEndPreamble{
{%
\beamertemplatenavigationsymbolsempty % switch off navigation symbols 
\setbeamertemplate{logo}{}            % and logo for first two slides
\begin{frame}
\maketitle
\end{frame}
\ifclassified   % show slide only if boolean is true
\begin{frame}{Classified}
This presentation is classified
\end{frame}
\fi % end if
}   % end scope of switching off navigation and logo
}

带有额外幻灯片的文档:

\documentclass{beamer}
\usepackage{iooci}
\author{John Smith}
\date{\today}
\begin{document}
\begin{frame}{First real slide}
\end{frame}
\end{document}

并且没有:

\documentclass{beamer}
\usepackage{iooci}
\author{John Smith}
\date{\today}
\classifiedfalse
\begin{document}
\begin{frame}{First real slide}
\end{frame}
\end{document}

结果(附有附加幻灯片):

在此处输入图片描述

答案2

我最终选择使用上面评论中@Fran 建议的变体。下面是向像我这样的未来人士提供的解释。采用@Marijn 代码的风格:

iooci.sty

\usepackage{etoolbox}

\institute{Institute of Often Classified Information}   % default institute and logo
\logo{\fbox{\Huge IoOCI}}

\setbeamertemplate{classificationframe}{%
  \begin{frame}
    \frametitle{Classified}
    This presentation is classified
  \end{frame}
}

文档

\documentclass{beamer}

\usepackage{iooci}
\author{John Smith}
\date{\today}
\begin{document}

\begin{frame}
    \maketitle
\end{frame}

\usebeamertemplate{classificationframe}

\begin{frame}{First real slide}
\end{frame}
\end{document}

为什么不做点更花哨的事情呢?我认为无论如何我都必须告诉用户如何做事,所以我选择了最直接的解决方案。

在此过程中,我探索了使用[allowframebreaks](见Beamer allowframebreaks 默认选项),但如果我重新定义frame以允许我将分类信息放在标题页模板上,则可能会破坏用户对新框架的工作方式的期望,包括\frame{\titlepage}和带有的框架[fragile]

Fran 和 Marijn,感谢你们花时间回答这个模糊的问题。这帮助我探索了我的可能性。

显然,任何比我最终得到的解决方案更好的解决方案仍然会受到欢迎。

相关内容