3

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}
  • 1
    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
4

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}%
    \addtocounter{cont}{1}%
    \addtocounter{cont}{-\beamer@startpageofframe}%
    (\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}

enter image description here

  • 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
  • 1
    @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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.