- Normally I have something like Frame 4 / 30 in the
footline
. - The total frame count is done by the command
\insertframenumber
. - In my beamer presentation, I have an extensive appendix/backup.
- Therefore I didn't want the appendix frames to be counted to the total frame count.
- I used this and that question to do that -- leading to a new custom command called
\myLastContentFrame
. - Everything was good.
- Now I used
overlay specification
s like[<+->]
and the\myLastContentFrame
sadly also considers the overlays into account.
How to determine the last frame before the appendix even if overlay specifications are used? In the appendix frames I want e. g. 34 / 30 (where 30 is the last content frame count).
\documentclass[c]{beamer}
%% Appearance
% -----------------------
\setbeamercolor{block title}{fg=white,bg=red}
\setbeamercolor{block body}{fg=black,bg=gray}
\setbeamercolor{background canvas}{bg=pink}
% -----------------------
%% Functionality
% -----------------------
\usepackage{xparse}
% https://tex.stackexchange.com/questions/347560
\ExplSyntaxOn
\DeclareExpandableDocumentCommand{\myLastContentFrame}{}
{
\fp_to_int:n
{
(
\use:c{beamer@startpageofappendix} - 1 > 0
?
\use:c{beamer@startpageofappendix} - 1
:
\inserttotalframenumber
)
}
}
\ExplSyntaxOff
% -----------------------
\begin{document}
\begin{frame}
\frametitle{Content Frame 1}
\begin{itemize}
\huge
\item \texttt{\textbackslash insertframenumber:} \insertframenumber
\item \texttt{\textbackslash inserttotalframenumber:} \inserttotalframenumber
\item \texttt{\textbackslash myLastContentFrame:} \myLastContentFrame
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Content Frame 1}
\begin{itemize}[<+->]
\huge
\item \texttt{\textbackslash insertframenumber:} \insertframenumber
\item \texttt{\textbackslash inserttotalframenumber:} \inserttotalframenumber
\item \texttt{\textbackslash myLastContentFrame:} \myLastContentFrame
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Last Content Frame}
\begin{itemize}[<+->]
\huge
\item \texttt{\textbackslash insertframenumber:} \insertframenumber
\item \texttt{\textbackslash inserttotalframenumber:} \inserttotalframenumber
\item \texttt{\textbackslash myLastContentFrame:} \myLastContentFrame
\end{itemize}
\begin{block}{Last Content Frame}
The number of this frame -- the last frame befpore the appendix starts -- should be the value of \texttt{\textbackslash myLastContentFrame}.
\end{block}
\end{frame}
\appendix
\begin{frame}
\frametitle{First Appendix Frame}
\Huge \textcolor{red}{Start of Appendix!}
\begin{itemize}
\huge
\item \texttt{\textbackslash insertframenumber:} \insertframenumber
\item \texttt{\textbackslash inserttotalframenumber:} \inserttotalframenumber
\item \texttt{\textbackslash myLastContentFrame:} \myLastContentFrame
\end{itemize}
\end{frame}
\end{document}