17

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!

1 Answer 1

23

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}
 }
1
  • No need for \begingroup and \endgroup. The environments used with \begin and \end already include a group themselves. Nov 8, 2013 at 18:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .