有什么区别:
\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}
}
和:
\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}
}
第一个表现正常,第二个每次重建时表现随机?我用pdflatex
和gummi
(预览)构建它。第二个在我不重建而是从头构建时不显示任何背景。对我来说很奇怪。
编辑:甚至第一个也以不同的主题随机行事......
答案1
来自beamer
用户指南:
因此,background canvas
一切都在后面,然后才是background
主要内容。
比较这些代码:
\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}
和
\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}
首先,您看到的here
是中心,其次,它位于后面(因为它在里面)background canvas
。