在节后使用背景模板

在节后使用背景模板

我正在尝试在幻灯片中插入整页图形,请参阅下面的 MWE。

第一次体验是,“标题”和“副标题”出现在正常位置。如果选择“纯文本”,我预计它们不会出现。

第二个,如果我取消注释“section”命令,我会在背景图的顶部有一个额外的幻灯片,其中“title”部分作为框架标题,尽管模板是本地的。我误解了什么吗?

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}

\begin{document}

%\section{sec}{title}
{
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{YourFigureHere}}%
\begin{frame}[plain]{Title}{Subtitle}
\end{frame}
}

\end{document}

答案1

第一个问题已在评论中得到解答。

在这里,我将解决第二个问题以及您在评论中提出的相关问题。

模板本地。但是,当包含模板规范的组打开时,出现杂散文本的框架并不完整。因此,在为该框架收集材料时设置模板。当您正确启动下一帧时,前一帧已完成并与背景模板一起发送出去。

如果您在框架之后但在组关闭之前添加杂散文本,则可以看到相反的效果。杂散文本被放入新框架中。此时,背景处于活动状态。但是,在仍在为框架收集材料时,组已关闭。因此,在收集该材料时,背景设置已关闭。当下一帧在本地组之外开始时,前一帧结束,并且该帧将使用当前默认的背景模板发货。

这展示起来比解释起来容易……

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}

\begin{document}

  \section[sec]{title}
  \color{blue!75!white}
  This text is lost, so \texttt{beamer} starts a new frame (1) to collect the stray material.

  \dots collecting material for frame 1\dots

  {
    \alert{A local group is started while material is being collected for frame 1.}

    \usebackgroundtemplate{\includegraphics[width=\paperwidth]{example-image-a}}
    \alert{The background template is changed, limited by the local group.}

    When \texttt{beamer} is told to begin the \emph{next} frame i.e.\ frame 2, it will have to end this one, frame 1.

    Frame 1 will be shipped out with the current, local background.

    \begin{frame}[plain]{Title}{Subtitle}
      This is frame 2. This text is where it should be. This frame begins and ends within the local group, so it will be shipped out with the current, local background.
    \end{frame}
    This is some more lost text, so \texttt{beamer} will try to find it a home.

    Since no frame is currently in progress, a new frame, frame 3, will be started and material will be collected.

    \alert{At this point, the local background is still in place\dots but frame 3 is not yet complete\dots}
  }

  \alert{Now we are outside the local group, so the background is reset to the default.}

  When frame 4 is started, \texttt{beamer} will finish frame 3 and ship it out with the current, non-local background.
  \begin{frame}[plain]{Another Frame}
    This is frame 4. This frame begins and ends outside the local group so it will be shipped out with the non-local background now current.
  \end{frame}   

\end{document}

群体框架效应

相关内容