![Beamer:如何从某一帧中删除全局背景图像?](https://linux22.com/image/278661/Beamer%EF%BC%9A%E5%A6%82%E4%BD%95%E4%BB%8E%E6%9F%90%E4%B8%80%E5%B8%A7%E4%B8%AD%E5%88%A0%E9%99%A4%E5%85%A8%E5%B1%80%E8%83%8C%E6%99%AF%E5%9B%BE%E5%83%8F%EF%BC%9F.png)
我已经设置了全局背景图片
\usebackgroundtemplate
{
\centering\includegraphics[width=\paperwidth,height=\paperheight{bgs/global.png}
}
问题是,我需要用纯白色背景替换某些帧(幻灯片),但我不知道如何做到这一点。
谢谢!
答案1
将白色框架放入一个空的组中usebackgroundtemplate
\documentclass{beamer}
\usebackgroundtemplate%
{
\centering\includegraphics[width=\paperwidth,height=\paperheight{bgs/global.png}
}
\begin{document}
\begin{frame}
this frame will have the global background
\end{frame}
{
\usebackgroundtemplate{}
\begin{frame}
This frame will have a white background
\end{frame}
}
\begin{frame}
this frame will have the global background
\end{frame}
\end{document}
您还可以创建具有空背景的自定义框架环境:
\newenvironment{whiteframe}
{
\usebackgroundtemplate{}
\begin{frame}
}
{
\end{frame}
}
为了使答案更通用,如果您想要不同于白色的背景颜色(这是一种特殊情况),您的自定义环境应该是:
\newenvironment{yellowframe}%
{
\setbeamertemplate{background canvas}[default]
\setbeamercolor{background canvas}{bg=yellow}
\begin{frame}
}
{
\end{frame}
}
或者你可以有一个阴影背景:
\newenvironment{yellowshadedframe}
{
\setbeamertemplate{background canvas}[vertical shading][bottom=yellow,top=white]
\begin{frame}
}
{
\end{frame}
}