8

What is difference between:

\setbeamertemplate{background}{
\begin{tikzpicture}[remember picture,overlay]
\shade[top color=yellow!75!green!33,bottom color=blue!66!green!33,middle color=blue!6!green!33]
  ([shift={(0.0cm,0.0cm)}]current page.north west)
     rectangle
  ([shift={(0.0cm,0.0cm)}]current page.south east);
\end{tikzpicture}  
}

and:

\setbeamertemplate{background canvas}{
\begin{tikzpicture}[remember picture,overlay]
\shade[top color=yellow!75!green!33,bottom color=blue!66!green!33,middle color=blue!6!green!33]
  ([shift={(0.0cm,0.0cm)}]current page.north west)
     rectangle
  ([shift={(0.0cm,0.0cm)}]current page.south east);
\end{tikzpicture}  
}

First one behaves corectly, the second one behaves randomly on each rebuild? I build it with pdflatex and with gummi (preview). And the second one doesn't show any background when I don't rebuild, but build from scratch. Quite weird for me.

Edit: even first one behaves randomly with different themes...

kravemir
  • 360

1 Answers1

7

From beamer user guide:

enter image description here

So, the background canvas goes behind everything, and on that comes background and then main contents.

Compare these codes:

\documentclass{beamer}
\usepackage{tikz}
\setbeamertemplate{background}{
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center) {here};
\end{tikzpicture}
}
\setbeamertemplate{background canvas}{
\begin{tikzpicture}[remember picture,overlay]
\shade[top color=yellow!75!green!33,bottom color=blue!66!green!33,middle color=blue!6!green!33]
  ([shift={(0.0cm,0.0cm)}]current page.north west)
     rectangle
  ([shift={(0.0cm,0.0cm)}]current page.south east);
\end{tikzpicture}
}
\begin{document}
  \begin{frame}
    Some
  \end{frame}
\end{document}

enter image description here

and

\documentclass{beamer}
\usepackage{tikz}
\setbeamertemplate{background canvas}{
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center) {here};
\end{tikzpicture}
}
\setbeamertemplate{background}{
\begin{tikzpicture}[remember picture,overlay]
\shade[top color=yellow!75!green!33,bottom color=blue!66!green!33,middle color=blue!6!green!33]
  ([shift={(0.0cm,0.0cm)}]current page.north west)
     rectangle
  ([shift={(0.0cm,0.0cm)}]current page.south east);
\end{tikzpicture}
}
\begin{document}
  \begin{frame}
    Some
  \end{frame}
\end{document}

enter image description here

In first you see here at the center and in second it goes behind (as it is inside background canvas.