[Tex/LaTex] Disable beamer frame numbering with framebreaks

beamerpage-numbering

In my beamer presentation, the bibliography frames (which are the last frames) are set not to be included in the numbering. Hence the total number of frames (printed as "current frame number/ total frame number") does not count the bibliography frames. I was using the following code for that:

\documentclass[xcolor={dvipsnames,table},11pt]{beamer}
\setbeamertemplate{footline}{\insertframenumber/\inserttotalframenumber}
\begin{document}
\begin{frame}[noframenumbering]
\begin{thebibliography}{}
\bibitem{} The total frame number is displayed as zero,
\bibitem{} which means the frames are not countered.
\end{thebibliography}
\end{frame}
\end{document}

It was working fine. Then I decided to include framebreaks, using the command:

\begin{frame}[noframenumbering, allowframebreaks]

The frames are broken correctly, but the blibliography frames are now numbered, except the first one. For example, if three bibliography slides are there, the total number gets increased to "x+(3-1)=x+2". What I need is an unchanged total frame number (ie "x+0").

Any suggestion would be helpful. Thanks in advance.

Best Answer

Manual hack:

\documentclass[xcolor={dvipsnames,table},11pt]{beamer}
\setbeamertemplate{footline}{\insertframenumber/\inserttotalframenumber}
\begin{document}
\frame{}

\begin{frame}[allowframebreaks]
\begin{thebibliography}{}
\bibitem{} The total frame number is displayed as zero,
\framebreak
\bibitem{} which means the frames are not countered.
\end{thebibliography}
\end{frame}
\addtocounter{framenumber}{-2}
\end{document}

Or an automatic solution if you can live with all allowframebreak frames to be unnumbered:

\documentclass[xcolor={dvipsnames,table},11pt]{beamer}

\setbeamertemplate{footline}{%
    \ifnum\insertcontinuationcount>0
        \addtocounter{framenumber}{-1}
    \fi
    \insertframenumber/\inserttotalframenumber
}

\begin{document}
\frame{}

\begin{frame}[allowframebreaks]
\begin{thebibliography}{}
\bibitem{} The total frame number is displayed as zero,
\framebreak
\bibitem{} which means the frames are not countered.
\end{thebibliography}
\end{frame}

\end{document}

enter image description here