# appendixnumberbeamer package fails to count correct number of slides in beamer

I recently reinstalled my Miktex (version 2.9. Windows 10 64 bit).

I am not sure if it is relevant: I found that I can no longer compile my presentation slides written in beamer. So I follow the instruction online and installed beamer and translator package manually using MikTex Package Manager to fix the problem.

Here is the problem: I find out that appendixnumberbeamer package fails to count the correct number of slides before \appendix. For example, I have 35 slides before \appendix and 4 slides after it. However, my slides show that I have only 4 slides and the slide number may show 35/4. The slide numbers after \appendix are correct.

I tried to compile the exact same file on my desktop, which has the same programs and system but MikTex was installed much earlier. The package works fine on my desktop and it gives me the correct number of slides. Does anyone know what might cause this problem?

Here is a mimum compatible code exmaple:

\documentclass[mathserif,10pt]{beamer}

\usecolortheme{beaver}

\usepackage{appendixnumberbeamer}

%----------------------------------------------
\title[Title]{Title}
\author[Last name, First name] % (optional, for multiple authors)
{First~Last}

\institute[Institute]{Institute} % (optional)

\date[\today] % (optional)
{ \today}

\begin{document}
\frame{\titlepage}
%-------------------------------------

\begin{frame}
\frametitle{Normal slide 1}
\end{frame}

\begin{frame}
\frametitle{Normal slide 2}
\end{frame}

\begin{frame}
\frametitle{Normal slide 3}
\end{frame}

\begin{frame}
\frametitle{Normal slide 4}
\end{frame}
%--------------------------------------------------

\appendix

\begin{frame}
\frametitle{Appendix slide 1}
\end{frame}

\begin{frame}
\frametitle{Appendix slide 2}
\end{frame}

\end{document}


• Welcome to TeX.SX! Please post a MWE (minimal compilable code example). – TeXnician Dec 30 '17 at 16:58
• Hi TeXnician. Thank you for your reply! I have posted an MWE and two pictures showing the problem that I have when I compile the MWE. Thank you. – shanmu .S Dec 30 '17 at 18:24
• Not related to your problem, but you should not use the mathserif option, use \usefonttheme[onlymath]{serif} instead. – samcarter_is_at_topanswers.xyz Dec 31 '17 at 14:01
• @samcarter Sorry for the late reply. I have made the changes based on your suggestion. If it is convenient, can you please tell me why I should not use mathserif option? – shanmu .S Jan 1 '18 at 19:46
• @shanmu.S mathserif is deprecated. If you use it you should find a warning in the .log file telling you to use \usefonttheme[onlymath]{serif} instead. – samcarter_is_at_topanswers.xyz Jan 1 '18 at 19:49

The problem is that in the commit https://github.com/josephwright/beamer/commit/cb9eed469a3e6d730d0fdbd950288c06927708e9#diff-a9851e406d02cf9fb3729ed1045df4d3 the definition of the total frame number was changed to global.

A dirty hack: in order to continue to use the appendixnumberbeamer package you could go back to a previous version of the beamerbasemisc.sty file, e.g. from https://raw.githubusercontent.com/josephwright/beamer/d46c01c35e839704109ae2cf34bd112de970910d/base/beamerbasemisc.sty and place it in the same folder as your .tex file.

Solution without the appendixnumberbeamer package:

\documentclass{beamer}

\usecolortheme{beaver}

\makeatletter
\setbeamertemplate{footline}
{%
\leavevmode%
\hbox{%
\end{beamercolorbox}%
\end{beamercolorbox}%
% appendix frames
\else%
% frames from main part
\fi%
\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother

\usepackage{totcount}
\newtotcounter{documentendframe}

\makeatletter
\renewcommand<>\appendix{%
\only#1{\part{\appendixname}%
\global\let\appendix\beamer@appendix}%
}
\makeatother

\begin{document}
\frame{\titlepage}
%-------------------------------------

\begin{frame}
\frametitle{Normal slide 1}
\end{frame}

\begin{frame}
\frametitle{Normal slide 2}
\end{frame}

\begin{frame}
\frametitle{Normal slide 3}
\end{frame}

\begin{frame}
\frametitle{Normal slide 4}
\end{frame}
%--------------------------------------------------

\appendix

\begin{frame}
\frametitle{Appendix slide 1}
\end{frame}

\begin{frame}
\frametitle{Appendix slide 2}
\end{frame}

\end{document}


Starting with beamer v. 3.49 you can emulate the behaviour of the appendixframenumber package by using \setbeamertemplate{page number in head/foot}[appendixframenumber] after your theme.

\documentclass{beamer}

\usecolortheme{beaver}

\begin{document}
\frame{\titlepage}
%-------------------------------------

\begin{frame}
\frametitle{Normal slide 1}
\end{frame}

\begin{frame}
\frametitle{Normal slide 2}
\end{frame}

\begin{frame}
\frametitle{Normal slide 3}
\end{frame}

\begin{frame}
\frametitle{Normal slide 4}
\end{frame}
%--------------------------------------------------

\appendix

\begin{frame}
\frametitle{Appendix slide 1}
\end{frame}

\begin{frame}
\frametitle{Appendix slide 2}
\end{frame}

\end{document}

• Thank you, @samcarter! Although I do not quite understand how it works, the "dirty hack" you suggested solved my problem. Hopefully, this will not cause any other problems and they will update it and fix the issue. Thanks a lot! – shanmu .S Dec 30 '17 at 21:38
• @shanmu.S You're welcome! I left a comment in the beamer github repo (github.com/josephwright/beamer/commit/…), let's hear what the beamer maintainers think about this. – samcarter_is_at_topanswers.xyz Dec 30 '17 at 21:45
• The Beamer sorceress answered again ;-) – user31729 Dec 31 '17 at 15:07
• @ChristianHupfer Oh, a new title :) Thank you! Guten Rutsch ins neue Jahr! – samcarter_is_at_topanswers.xyz Dec 31 '17 at 15:28
• @samcarter: Danke, ebenfalls. Gruss an die anderen von SG-1 ;-) – user31729 Dec 31 '17 at 15:29

The appendixnumberbeamer package has just been updated to fix this, see https://github.com/jlelong/appendixnumberbeamer. The new version has also been uploaded to CTAN.

• Thank you for the update! This information is very helpful and we do not need to worry about this problem anymore. – shanmu .S Mar 31 '18 at 17:42