[Tex/LaTex] Change Beamer frame background between slides in same itemize

beamer

I would like to use the slide backgrounds to illustrate the individual items of an itemize environment. However, the background image has to be specified outside the frame for all I know, and only, onslide, uncover, etc. don’t seem to work as expected there (the background is displayed on all slides for values equal 1 and hidden on all slides otherwise).

This is sort of how I’d like to use it, but it doesn’t work of course:

{
    \only<1>{\usebackgroundtemplate{\includegraphics[width=\paperwidth]{assets/background-01.png}}}%
    \only<2>{\usebackgroundtemplate{\includegraphics[width=\paperwidth]{assets/background-02.png}}}%
    \only<3>{\usebackgroundtemplate{\includegraphics[width=\paperwidth]{assets/background-03.png}}}%
    \frame{
        \frametitle{Promotion}
        \begin{itemize}[<+->]
            \item Identifying the target audience
            \item Understanding the target audience
            \item Identifying partners
         \end{itemize}
    }
}

Thank you!

Best Answer

I think what you want is not possible. Take a look at How does beamer build the frame? and will see that background canvas and background are constructed before anything else and the frame contents is the last piece, after titles and sidebars. Therefore even trying to supply a false background with TiKZ overlay and remember picture this background will cover any previous layer.

Next code shows a manual solution built playing with \visible and \invisible. You'll need to build as much as frames as items and if your slides are numbered, you'll need to find how to adjust them.

\documentclass{beamer}

\usepackage{mwe}

\begin{document}
\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{example-image-a}}
\begin{frame}{Promotion}
\begin{itemize}
\item\visible<1>{Identifying the target audience}
\item\invisible<1>{Understanding the target audience}
\item \invisible<1>{Identifying partners}
\end{itemize}
Some text
\end{frame}

\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{example-image-b}}
\begin{frame}{Promotion}
\begin{itemize}
\item\visible<1>{Identifying the target audience}
\item\visible<1>{Understanding the target audience}
\item \invisible<1>{Identifying partners}
\end{itemize}
Some text
\end{frame}

\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{example-image-c}}
\begin{frame}{Promotion}
\begin{itemize}
\item\visible<1>{Identifying the target audience}
\item\visible<1>{Understanding the target audience}
\item\visible<1>{Identifying partners}
\end{itemize}
Some text
\end{frame}

\end{document}

enter image description here