[Tex/LaTex] Beamer: How to remove global background image from a certain frame

backgroundsbeamer

I have set a global background image

\usebackgroundtemplate
{
    \centering\includegraphics[width=\paperwidth,height=\paperheight{bgs/global.png}
}

The problem is, I need to replace this with a solid white background for certain frames (slides), but I can't figure out how to do that.

Thanks!

Best Answer

Include the white frames into a group with an empty 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}

you may also create a custom frame environment with an empty background:

\newenvironment{whiteframe}
{
 \usebackgroundtemplate{}
 \begin{frame}
}
{
 \end{frame}
}

To make the answer a bit more general, if you'd like a background color different from white (which is a kind of special case) your custom environment should be:

\newenvironment{yellowframe}%
 {
  \setbeamertemplate{background canvas}[default]
  \setbeamercolor{background canvas}{bg=yellow}
  \begin{frame}
 }
 {
  \end{frame}
 }

or you could have a shaded background:

\newenvironment{yellowshadedframe}
 {
  \setbeamertemplate{background canvas}[vertical shading][bottom=yellow,top=white]
  \begin{frame}
 }
 {
  \end{frame}
 }