2

I have recently built a custom beamer theme using tikz and wanted to add notes to my slides. Without notes it looked like this:

Without Notes

After inserting

\usepackage{pgfpages}
\setbeameroption{show notes on second screen}

it looked like this:

With Notes

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?

7
  • It seems like the background library is not compatible with pgfpages. Not surprising because both involve post-processing the picture. What you can do is, since you are using remember 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 remove show background .......
    – Symbol 1
    Mar 16 '20 at 20:57
  • Thanks for your suggestion. Adding \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.
    – Vanessa
    Mar 17 '20 at 14:45
  • Can you set \setbeamercolor{background canvas}{bg=white} back after the section page? It's verbose I know. But at least get it to work.
    – Symbol 1
    Mar 17 '20 at 17:12
  • 1
    I don't know what current bounding box means in this situation. \fill[yellow](current page.south west)rectangle(current page.north east); would make more sense
    – Symbol 1
    Mar 17 '20 at 17:18
  • Interestingly with \fill[gray](current page.south west)rectangle(current page.north east); it works. Would be the preferred solution.
    – Vanessa
    Mar 19 '20 at 10:41
1

Instead of using

\usetikzlibrary{backgrounds}
\begin{tikzpicture}[remember picture, overlay, show background rectangle, background rectangle/.style={fill=gray}]

with

\begin{tikzpicture}[remember picture, overlay]
\fill[gray](current page.south west)rectangle(current page.north east);

the problem does not occur.

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.