beamer add tag
Vanessa (imported from SE)
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][1]][1]

After inserting

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

it looked like this:

[![With Notes][2]][2]

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?

  [1]: https://i.stack.imgur.com/H0Rp2.png
  [2]: https://i.stack.imgur.com/OkiZA.png
Top Answer
samcarter
### Update:

This problem has just been fixed in the development version of beamer (https://github.com/josephwright/beamer/commit/2e0b09acb735abf0b45856534bd5ff8c01bf7a5d).

---
That's a fascinating question!

In fact all the decorations of the main slide are draw as they should, but the tiny preview at the top right will draw the gray background not only within the preview area, but over the whole page. 

This can be avoided by removing `background rectangle/.style={fill=gray}`. Instead the background can either be drawn with `\fill[gray] (current page.south west) rectangle (current page.north east);` or one could alter beamers background colour for these slides using `\setbeamercolor{background canvas}{bg=gray}`

```
\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]
      \fill[gray] (current page.south west) rectangle (current page.north east);
      \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}
```

![Screen Shot 2020-03-06 at 18.10.05.png](/image?hash=c156e01fc7cbbdb1a979572722472f7eeff7730eced0a3db6a175605c3652854)

----

### Patching beamer

Another approach could be to patch beamer

```
\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}
}
  
  
\makeatletter
\renewcommand{\insertslideintonotes}[1]{{%
  \begin{pgfpicture}{0cm}{0cm}{#1\paperwidth}{#1\paperheight}
    \begin{pgflowlevelscope}{\pgftransformscale{#1}}%
      \color{normal text.bg}
      \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\paperwidth}{\paperheight}}
      \pgfusepath{fill,clip}
      \color{normal text.fg}
      {\pgftransformshift{\pgfpoint{\beamer@origlmargin}{\footheight}}\pgftext[left,bottom]{\copy\beamer@frameboxcopy}}
    \end{pgflowlevelscope}
  \end{pgfpicture}%
  }}

\makeatother

  
\begin{document}
  
\section{Some section}
\subsection{Some subsection}
\begin{frame}[plain]
  \sectionpage
\end{frame}
  
\end{document}
```

This room is for discussion about this question.

Once logged in you can direct comments to any contributor here.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.