Skip to content

correct label data #917

@u-fischer

Description

@u-fischer

In beamer anchors are created by the \label command, have the name of the key and \ref{key} references the anchor key.

The data written to the aux-file doesn't reflect that. Beamer always writes Doc-Start as anchor.

\newlabel{blub}{{2}{2}{}{Doc-Start}{}}

This makes it hard for other code to create correct hyperlinks, for example \hyperref doesn't work, but also zref-clever has problems https://tex.stackexchange.com/q/730782/2388 (and the tagging code needs the anchors too)

I suggest to update \@currentHref before issuing the label:

\documentclass{beamer}

\makeatletter
\def\beamer@label<#1>#2%
 {\alt<#1>{\gdef\@currentHref{#2}% <-- new
   \beamer@origlabel{#2}\beamer@nameslide{#2}}{\beamer@dummynameslide}}
\makeatother

\begin{document}

\begin{frame}
First page
\end{frame}


\begin{frame}
\label{blub}
Goal
\end{frame}

\begin{frame}
\hyperref[blub]{jump}
\end{frame}

\end{document}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions