For my lecture slides in beamer
I would like to establish a section-framenumber numbering scheme. For this purpose I reset frame counter in \AtBeginSection
and redefine the \insertframenumber
command to reflect the new numbering scheme:
\renewcommand{\insertframenumber}{\thesection-\theframenumber}
\AtBeginSection{\setcounter{framenumber}{0}}
This works pretty well. However, I have not succeeded in getting cross-references right in this respect, that is to refer to some labeled \frame[label=interesting]
as section-framenumber. Apparently, there is no way to, given the label, extract the section number:
\documentclass{beamer}
\renewcommand{\insertframenumber}{\thesection-\theframenumber}
\setbeamertemplate{headline}[text line]{This is frame: \insertframenumber}
\AtBeginSection{\setcounter{framenumber}{0}}
\begin{document}
\section{One}
\begin{frame}{First Frame in Section One}
Slide content\par
\pause
More content
\end{frame}
\begin{frame}[label=interesting]{Second Frame in Section One -- The one to crossref to}
Slide content
\end{frame}
\section{Two}
\begin{frame}{First Frame in Section Two}
Now I want to crossref to interesting slide by section-framenumber (that is, somehow generate \textbf{1-2})
\begin{itemize}
\item \textbackslash{}ref yields: \ref{interesting}, apparently that is the frame number
\item \textbackslash{}page yields: \pageref{interesting}, apparently that is the PDF page number
\item \textbackslash{}autoref yields: \autoref{interesting}, apparently that is the frame number again
\item nothing there that yields \textbackslash{}thesection of our target label?
\end{itemize}
\end{frame}
\end{document}
I took a look at the generated .aux
-file. I am not really good in deciphering .aux
-files; however, as I read it, beamer does not even store there the section number (1 in this case) the label belongs to:
...
\newlabel{interesting<1>}{{2}{3}{One\relax }{Doc-Start}{}}
...
So am I out of luck here?
Edit: I am now considering looking into the zref
package to solve my problem. The challenge will probably be to get it integrated with the label=mylabel
frame option, which implicitly generates those helpful "overlay" labels (mylabel<1>
, mylabel<2>
, ...
) to refer to individual slides of a frame.
Any hints or ideas still are more than welcome :-)