[Tex/LaTex] Avoid frame numbering in references that span more than one frame in Beamer

beamerbibliographiesnumbering

I am creating a presentation with Beamer, in which my references span more than one frame. In order to have the references automatically split in multiple frames I used the allowframebreaks parameter.

Also, I do not want to include the reference frames in the frame numbering. Therefore, I tried to ignore those frames with two different approaches:

By using addtocounter to decrement the total frame number

\begin{frame}[plain, allowframebreaks]
    \frametitle{References}
    \bibliographystyle{abbrv}
    {\tiny \bibliography{bibliography}}
    \addtocounter{framenumber}{-1}  % <---- HERE
\end{frame}

By using noframenumbering (available since v. 3.08) to simply ignore the frame

\begin{frame}[plain, allowframebreaks, noframenumbering] % <---- HERE
    \frametitle{References}
    \bibliographystyle{abbrv}
    {\tiny \bibliography{bibliography}}
\end{frame}

The problem I am facing is that just the first reference frame is being ignored, no matter the approach used. The additional ones (automatically split by the use of allowframebreaks) are always being accounted in the total frame number (checked with \inserttotalframenumber).

I would very much appreciate any help in pointing out what I am doing wrong. 🙂

Best Answer

I found this thread which is very similar to my problem, even though it is about appendix frames instead of bibliography frames.

Among the answers, this one indicates that the parameter noframenumbering is not inherited by the additional frames added by allowframebreaks and proposes to add the following code to the preamble:

\usepackage{etoolbox}
\makeatletter
\preto{\appendix}{%
  \patchcmd{\beamer@continueautobreak}{\refstepcounter{framenumber}}{}{}{}}
\makeatother

I tried to do something similar for my need (i.e. changing \appendix for \bibliography), but could not succeed. Errors like the following were presented, indicating that perhaps the \bibliography command does not have a similar structure to the \appendix command:

Argument of \bibliography has an extra } ...reak}{\refstepcounter{framenumber}}{}{}{}}

However, I tried this other answer that proposes to handle the frames as backup frames. First, it proposes to add the following macros to the preamble:

\newcommand{\backupbegin}{
   \newcounter{framenumberappendix}
   \setcounter{framenumberappendix}{\value{framenumber}}
}
\newcommand{\backupend}{
   \addtocounter{framenumberappendix}{-\value{framenumber}}
   \addtocounter{framenumber}{\value{framenumberappendix}} 
}

And then it proposes to use those macros to enclose the definition of the frames you do not want to have influence in the frame numbering.

So, I defined my reference frames like this:

\backupbegin
\begin{frame}[plain, allowframebreaks]
    \frametitle{References}
    \bibliographystyle{abbrv}
    {\tiny \bibliography{bibliography}}
\end{frame}
\backupend

And it all worked like a charm! The additional frames no longer are being accounted in the frame numbering. :)

P.S.: If somebody knows how to use the solution for the first answer referred to bibliographies, that would be very useful. It seems to me that that approach "feels" to be more correct.