How do I insert the total continuation count in the allowframbreaks frame title?

I would like to change the numbering of allowframbreaks frame, for instance, from I II III to (1/3) (2/3) (3/3)， but fail to find out a command to get the total continuation count. Here is the MWE.

\documentclass[compress]{beamer}
\usetheme{Warsaw}

%allowframebreaks numbering in the title
\setbeamertemplate{frametitle continuation}{(\insertcontinuationcount/)}
%\setbeamertemplate{frametitle continuation}{(\insertcontinuationcount/\inserttotalcontinuationcount)}

\title{title}
\author{author}

%%%%%
\begin{document}

\begin{frame}[allowframebreaks]{allowframebreaks title}
frame 1
\framebreak

frame 2
\framebreak

frame 3
\framebreak
\end{frame}

\end{document}

• Please complete your MWE and make it compilable – user36296 Oct 26 '15 at 17:35
• @samcarter thx. I edited the question. – SparkAndShine Oct 26 '15 at 21:40

The \inserttotalcontinuationcount can easily be calculated from the start and end of the frame:

\documentclass[compress]{beamer}
\usetheme{Warsaw}

\newcounter{cont}

\makeatletter
%allowframebreaks numbering in the title
\setbeamertemplate{frametitle continuation}{%
\setcounter{cont}{\beamer@endpageofframe}%
(\insertcontinuationcount/\arabic{cont})%
}
\makeatother

\title{title}
\author{author}

%%%%%
\begin{document}

\begin{frame}[allowframebreaks]{allowframebreaks title}
frame 1
\framebreak

frame 2
\framebreak

frame 3
\framebreak
\end{frame}

\end{document}


• I just successfully used your code - works great (this should the default beamer behaviour). Can you explain the logic of the three lines containing setcounter and addcounter? – Dr. Manuel Kuehner Jan 29 '17 at 18:03
• @Dr.ManuelKuehner These lines calculate the total number of slides within a frame by taking the pagenumber of the last slide of the frame and substracting the pagenumber of the first slide of the frame -> voila, this is the number of slides in the frame. – user36296 Jan 29 '17 at 20:35