1

I'm doing slides with beamer using the mtheme. This theme includes the slide number in the bottom of the page using this code:

\begin{beamercolorbox}[wd=\textwidth,ht=3ex,dp=3ex,leftskip=0.3cm,rightskip=0.3cm]{structure}%
  \hfill\usebeamerfont{page number in head/foot}%
  \insertframenumber%
\end{beamercolorbox}%
}

I wanted to the number to appear as x/X, being X the total number of slides, which can be displayed via \inserttotalframenumber. So i change the third line above to:

\insertframenumber/\inserttotalframenumber%

Now, the problem is that I have a slide at the end that should NOT count in the total number of frames, and so the result is that it's showing x/X, begin X one unit bigger than it should.

How could I do it so it displays \inserttotaframenumber-1. I saw calc allows for simple calculations but using the package and writing just \insertotalframenumber-1 does not work.

Can I do this some how?

Thank you.

2

You can use a counter:

\newcounter{mynumber}
\setcounter{mynumber}{\inserttotalframenumber}
\addtocounter{mynumber}{-1}
%% Now use:
\insertframenumber/\themynumber
  • It's displaying a 0. And why do you use \themynumber instead of \mynumber? – MyUserIsThis Jun 25 '15 at 9:25
  • The 0 should be ok, if you have 1 frame. Keep in mind to compile twice! – Scz Jun 25 '15 at 12:22
  • @MyUserIsThis: \the<counter> is the normal way to access the value of a counter. – Scz Jun 25 '15 at 12:24

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.