0

Is there a command \inserttotalslidenumber, similar to, for example, \inserttotalframenumber?

I would like to be able to write something like this:

\begin{frame}
  \frametitle{The title (\insertslidenumber/\inserttotalslidenumber)}
   %
   \only<+->{Some content.}
   \only<+->{Some more content.}
\end{frame}

To generate "The title (1/2)" and "The title (2/2)" on the respective slides.

Edit:

There is currently no out-of-the-box command for this. See samcarter's response below for a way to make the calculation.

  • In addition, look for frametitle continuationin the beamer manual. – Dr. Manuel Kuehner Apr 3 '18 at 7:15
  • I had already found that answer, but was wondering if beamer defines a more "standard" way of doing so. Is the answer basically "no"? – dow Apr 3 '18 at 8:09
  • 1
    (1) Then next time maybe refer to the related question that you already found - this saves others time. It's your 17th question - you are not a newbie anymore :). (2) I am afraid that there is no more standard way. – Dr. Manuel Kuehner Apr 3 '18 at 8:17
  • So every time one asks a question, they also need to mention the other 200 links they already checked? That answer is rather far from what I was looking for. Given the plethora of other \insert commands available, one would not expect to have to make the calculations mentioned there... – dow Apr 3 '18 at 8:27
  • 1
    @dow You should add all the information you already have to you questions to help the people willing to help you! – user36296 Apr 3 '18 at 8:31
2

\insertslidenumber was recently added to beamer, but you still need toc calculate the total number of slides in the frame.

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

\newcounter{cont}

\makeatletter
\newcommand{\inserttotalslidenumber}{    \setcounter{cont}{\beamer@endpageofframe}%
    \addtocounter{cont}{1}%
    \addtocounter{cont}{-\beamer@startpageofframe}%
    \arabic{cont}%
}
\makeatother

\title{title}
\author{author}

%%%%%
\begin{document}   

\begin{frame}
  \frametitle{The title (\insertslidenumber/\inserttotalslidenumber)}
   %
   \only<+->{Some content.}
   \only<+->{Some more content.}
\end{frame}

\end{document}
  • Thanks for the information regarding \insertslidenumber! Good to know – Dr. Manuel Kuehner Apr 3 '18 at 8:34
  • Sam, I have updated the question to reflect what I had in mind. Would you mind adding a sentence along the lines of "there is no out-of-the-box way to do that as of now", preferably at the beginning of your response? Thanks! – dow Apr 3 '18 at 18:28

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.