I'm using a LaTeX Beamer frame counter that displays
\insertframenumber/\inserttotalframenumber
… which would mean that if my project has twenty frames and the slideshow is on the sixteenth frame, "16/20" is displayed.
My project contains very long sections (they mirror book chapters), and I want the frames of each section to have a counter local to that section.
For example, if that sixteenth frame is actually in section 2, and section 1 had 5 frames, then it should show "11/15".
Maybe there's a solution with \AtBeginSection
, but I doubt it, since there would be no good way of calculating \inserttotalframenumber
to my knowledge.
If it helps, here's an MWE of my current setup (with fewer frames):
%%% Preamble %%%
\documentclass{beamer}
\usetheme{Antibes}
\usebeamercolor{dolphin}
% Make slide numbers appear, and they appear next to navigation
\addtobeamertemplate{navigation symbols}{}{%
\usebeamerfont{footline}%
\usebeamercolor[fg]{footline}%
\hspace{1em}%
\insertframenumber/\inserttotalframenumber
}
%%% Document %%%
\begin{document}
\section{First section}
\begin{frame}
\frametitle{First}
This frame should show ``1/2'', not ``1/5''.
\end{frame}
\begin{frame}
\frametitle{Second}
This frame should show ``2/2'', not ``2/5''.
\end{frame}
\section{Second section}
\begin{frame}
\frametitle{Third}
This frame should show ``1/3'', not ``3/5''.
\end{frame}
\begin{frame}
\frametitle{Fourth}
This frame should show ``2/3'', not ``4/5''.
\end{frame}
\begin{frame}
\frametitle{Fifth}
This frame should show ``3/3'', not ``5/5''.
\end{frame}
\end{document}
Best Answer
The following approach inserts a "label" into the
.aux
at every\section
(including at the end of the document) in order to capture the current frame number. This captured frame number (which resets with every\section
thanks tochngcntr
) is then inserted in the footer.