The little dots in the footer are now hyperlinks

This commit is contained in:
Lukas Pietzschmann
2022-12-20 18:17:11 +01:00
parent afaeab22e1
commit bd86c8e744

View File

@@ -35,6 +35,7 @@
\RequirePackage{fontspec} \RequirePackage{fontspec}
\RequirePackage{calc}
\RequirePackage{microtype} \RequirePackage{microtype}
\RequirePackage{etoolbox} \RequirePackage{etoolbox}
\RequirePackage{chngcntr} \RequirePackage{chngcntr}
@@ -150,12 +151,20 @@
\immediate\write\@auxout{\global\noexpand\@namedef{s@totalsectionframes-\arabic{section}}{\theframesinsection}} \immediate\write\@auxout{\global\noexpand\@namedef{s@totalsectionframes-\arabic{section}}{\theframesinsection}}
} }
\newcounter{secinc}
\pretocmd{\section}{ \pretocmd{\section}{
% At this point, the section command has not yet incremented the section counter, so we need to do this by ourselves
\setcounter{secinc}{\thesection + 1}
\refreshcountsinaux \refreshcountsinaux
\immediate\write\@auxout{\global\noexpand\@namedef{s@frameatsecstart-\arabic{subsecinc}}{\insertframenumber}}
}{}{} }{}{}
\newcounter{subsecinc}
\pretocmd{\subsection}{ \pretocmd{\subsection}{
% At this point, the subsection command has not yet incremented the subsection counter, so we need to do this by ourselves
\setcounter{subsecinc}{\thesubsection + 1}
\refreshcountsinaux \refreshcountsinaux
\immediate\write\@auxout{\global\noexpand\@namedef{s@frameatsubsecstart-\arabic{section}-\arabic{subsecinc}}{\insertframenumber}}
}{}{} }{}{}
\AtEndDocument{ \AtEndDocument{
@@ -178,6 +187,22 @@
} }
} }
\newcommand{\insertsectionstartframe}{
\ifcsdef{s@frameatsecstart-\arabic{section}}{
\csname s@frameatsecstart-\arabic{section}\endcsname
}{
0
}
}
\newcommand{\insertsubsectionstartframe}{
\ifcsdef{s@frameatsubsecstart-\arabic{section}-\arabic{subsection}}{
\csname s@frameatsubsecstart-\arabic{section}-\arabic{subsection}\endcsname
}{
0
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -418,6 +443,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcounter{pagenumbertolinkto}
\setbeamertemplate{footline}{ \setbeamertemplate{footline}{
\leavevmode% \leavevmode%
\hbox{% \hbox{%
@@ -428,7 +454,7 @@
dp=1ex dp=1ex
]{footline}% ]{footline}%
\hspace{0.3cm}% \hspace{0.3cm}%
\insertauthor% \insertauthor~\insertsectionstartframe~\insertsubsectionstartframe~\insertframenumber%
\hfill% \hfill%
\inserttitle\hspace{.7em}$\cdot$\hspace{.7em}\insertsection% \inserttitle\hspace{.7em}$\cdot$\hspace{.7em}\insertsection%
\ifx\insertsubsection\empty \ifx\insertsubsection\empty
@@ -438,7 +464,8 @@
\ifnum \i=\theframesinsection% \ifnum \i=\theframesinsection%
~$\bullet$% ~$\bullet$%
\else% \else%
~$\circ$% \setcounter{pagenumbertolinkto}{\i + \insertsectionstartframe}%
~\hyperlink{page:\thepagenumbertolinkto}{$\circ$}%
\fi% \fi%
}% }%
\fi% \fi%
@@ -450,7 +477,8 @@
\ifnum \i=\theframesinsubsection% \ifnum \i=\theframesinsubsection%
~$\bullet$% ~$\bullet$%
\else% \else%
~$\circ$% \setcounter{pagenumbertolinkto}{\i + \insertsubsectionstartframe}%
~\hyperlink{page:\thepagenumbertolinkto}{$\circ$}%
\fi% \fi%
}% }%
\fi% \fi%
@@ -518,6 +546,13 @@
% Kinda hacky, but AtBeginEnvironment does not work with beamer tex.stackexchange.com/a/436338/286979 % Kinda hacky, but AtBeginEnvironment does not work with beamer tex.stackexchange.com/a/436338/286979
\pretocmd\beamer@checkframetitle{ \pretocmd\beamer@checkframetitle{
\transfade[duration=0.1] \transfade[duration=0.1]
\ifbeamer@isfragile
\label{page:\insertframenumber}
\else%
\ifbeamer@noframenumbering\else%
\label{page:\insertframenumber}
\fi%
\fi%
} }