[Tex/LaTex] Run macro on each frame in beamer

beamer

How to patch the beamer \frame command (frame environment) so that \note{} is executed on every frame. This question is closely related to this one, however, I want the additional macro (\note{} in my case) to be executed not before but on every frame, that is:

\begin{frame}
    % empty dummy note, ensures that beamer renders a note page for this frame
    % if compiled with \setbeameroption{show notes}
    \note{}

    % frame content (may contain "real" \note commands, which accumulate)

\end{frame}

I am trying to achieve that in the resulting PDF every slide (even from frames that do not specify notes) is followed by a notes pages, so that I can use pdfnup --nup 1x2 (or similar tools) to pair them on the same page. That is, the following minimal example should result in a 4 page PDF file:

\documentclass{beamer}
\setbeameroption{show notes}

\begin{document}

\begin{frame}{Slide with notes}
  Slide content
  \note{Cool note!}
\end{frame}

\begin{frame}{Slide without a single note (a notes page should follow nevertheless!)}
  More slide content:
\end{frame}

\end{document}

Side note: I do not want any solution that builds on pgfpages (such as "notes on second screen"), as this package interferes at the shipout level with the textpos package, which I absolutely need for absolute positioning. The results look "funny" at best!

Any ideas are welcome!

Best Answer

This seemed to work for your small example:

\makeatletter
\def\beamer@framenotesbegin{% at beginning of slide
  \gdef\beamer@noteitems{}%
  \gdef\beamer@notes{{}}% used to be totally empty.
}
\makeatother

Mind you, I've not put too much thought into it, so complain if it doesn't work. :)