6

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...

6

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.

  • And when you use remember picture, you have to compile 2-3 times to settle down. – user11232 Dec 4 '14 at 13:49
  • Thanks. You answered the question, as it seems, bug is caused by something else. – kravemir Dec 5 '14 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.