wrong page labels when using \pause and \setbeameroption{show notes on second screen}
the labels of pages are messed-up when using \pause in a frame in conjunction with \setbeameroption{show notes on second screen}.
minimal sample below:
\documentclass{beamer}
\setbeameroption{show notes on second screen}
\setbeamertemplate{footline}[frame number]
\begin{document}
\begin{frame}
\begin{itemize}
\item 1
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item 2
\pause
\item 3
\end{itemize}
\end{frame}
\end{document}
opening the resulting document show that even if the frame number is right (see bottom right of the pages), the pdf label is wrong (see 1 instead of 2 for the second page in the thumbnails sidebar)
this matters because page labels are used by presenter tools to detect frames.
On 3.63 and 3.68 I see a similar issue when using evince to view. I am not using \pause anywhere that is visible in the source tex file.
\setbeameroption{show notes on second screen=right}
producing
and
\setbeameroption{show notes}
producing

I tried to resolve this by myself, but my knowledge of beamer internals is weak. commenting this line: https://github.com/josephwright/beamer/blob/main/base/beamerbasenotes.sty#L110 solves this issue for the minimal example I reported, but produce even weirder result for more complex cases (e.g. producing this labels 1, 2, 2, 4, 2, 6, 3 where i should get 1, 2, 2, 3, 3, 3, 4 for a doc with 4 frames having 1, 2, 3 and 1 steps)
knowledge of how pgfpages works looks necessary to dig into that …
Workaround
Redefine the command pgfpagescurrentpagewillbelogicalpage and beamer@outsideframenote in the preamble to make the pdf page label same with the frame label:
\makeatletter
\ltx@ifpackageloaded{pgfpages}{%
\let\old@pgfpagescurrentpagewillbelogicalpage\pgfpagescurrentpagewillbelogicalpage
\renewcommand\pgfpagescurrentpagewillbelogicalpage{%
\renewcommand*{\HyPL@EveryPage}{\relax}%
\old@pgfpagescurrentpagewillbelogicalpage}
}{}
\let\old@beamer@outsideframenote\beamer@outsideframenote
\renewcommand\beamer@outsideframenote{%
\renewcommand*{\thepage}{\insertframenumber}%
\old@beamer@outsideframenote}
\makeatother
Explanation
The pdf page label is added by the hyperref package. In every page, hyperref write out some page info to aux file using \HyPL@EveryPage and the pdf page label is set to \thepage.
-
In the case with option
show notes on second screen, adding the following line\renewcommand*{\HyPL@EveryPage}{\relax}%before the line
\pgfpagescurrentpagewillbelogicalpage{2}in filebeamerbasenotes.sty#L110will disable writing page label information into the PDF file when outputting note slides. -
For the case with option
show notes, set the macro\thepage\renewcommand*{\thepage}{\insertframenumber}in the definition of
beamer@outsideframenoteto make the note page label same as the frame number. or you can add a prefix for the note page like this\renewcommand*{\thepage}{notes-\insertframenumber}