I have recently built a custom beamer theme using tikz and wanted to add notes to my slides. Without notes it looked like this:
After inserting
\usepackage{pgfpages}
\setbeameroption{show notes on second screen}
it looked like this:
I prepared a small example
\documentclass[aspectratio=169]{beamer}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usepackage{pgfpages}
\setbeameroption{show notes on second screen}
% Colors
\definecolor{green}{RGB}{0,152,152}
\definecolor{gray}{RGB}{128,128,128}
% Define section page layout
\setbeamercolor{section}{fg=white}
\setbeamercolor{subsection}{fg=gray}
\setbeamertemplate{section page}%
{
\begin{tikzpicture}[remember picture, overlay, show background rectangle, background rectangle/.style={fill=gray}]
\draw[green, fill=green]
(-1,0.375) rectangle (13.66,-1.25);
\node[text width=14.21cm, minimum width=14.66cm, minimum height=1.625cm, anchor=south west]
at (-1, -1.25)
{
\begin{beamercolorbox}[right]{section}
\usebeamerfont{title}\insertsection
\end{beamercolorbox}
};
\draw[lightgray, fill=lightgray] (2.2,-1.335) rectangle (13.66, -2.2);
\node[text width=11.01cm, minimum width=11.46cm, minimum height=0.865cm, anchor=north west]
at (2.2,-1.335)
{
\begin{beamercolorbox}[right]{subsection}
\usebeamerfont{author}\insertsubsection
\end{beamercolorbox}
};
\end{tikzpicture}
}
\begin{document}
\section{Some section}
\subsection{Some subsection}
\begin{frame}[plain]
\sectionpage
\end{frame}
\end{document}
I have really no idea what happened here. I compiled it with pdflatex but latex -> dvips -> ps2pdf, xelatex und lualatex produce the same output. The text is still there, you can copy and paste it. It looks like the background moved itself to the foreground...
Does anybody have an idea how to solve this problem?
background
library is not compatible withpgfpages
. Not surprising because both involve post-processing the picture. What you can do is, since you are usingremember picture,overlay
already, you just draw a ridiculously big rectangle as background. Or you use beamer's protocol to set bg color. At least I saw what you expected when I removeshow background .......
\draw[gray, fill=gray] (current bounding box.north west) rectangle (current bounding box.south east);
as first command within the tikzpicture environment yields to the same result. Changing the beamer color for background canvas by simply using\setbeamercolor{background canvas}{bg=gray}
works. However, all frames have a gray background and I want only the section page to have a gray background. I have not found a solution applying this change only to the section page.\setbeamercolor{background canvas}{bg=white}
back after the section page? It's verbose I know. But at least get it to work.current bounding box
means in this situation.\fill[yellow](current page.south west)rectangle(current page.north east);
would make more sense\fill[gray](current page.south west)rectangle(current page.north east);
it works. Would be the preferred solution.