Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong page labels when using \pause and \setbeameroption{show notes on second screen} #807

Open
rndblnch opened this issue Nov 29, 2022 · 3 comments

Comments

@rndblnch
Copy link

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)

Screenshot 2022-11-29 at 23 28 19

this matters because page labels are used by presenter tools to detect frames.

@tgbugs
Copy link

tgbugs commented Dec 9, 2022

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
2022-12-08-223010-snip
and

\setbeameroption{show notes}

producing
2022-12-08-223302-snip

@rndblnch
Copy link
Author

rndblnch commented Dec 9, 2022

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 …

@lrtfm
Copy link

lrtfm commented May 9, 2024

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.

  1. In the case with option show notes on second screen, adding the following line

    \renewcommand*{\HyPL@EveryPage}{\relax}%
    

    before the line \pgfpagescurrentpagewillbelogicalpage{2} in file beamerbasenotes.sty#L110 will disable writing page label information into the PDF file when outputting note slides.

  2. For the case with option show notes, set the macro \thepage

    \renewcommand*{\thepage}{\insertframenumber}
    

    in the definition of beamer@outsideframenote to 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}
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants