[Tex/LaTex] Switching between arabic, roman and alph frame numbering

beamerpage-numbering

I just wonder how can I easily switch to arabic, roman or alph frame numbering between frames?

I don't want to use \appendix! I want, for instance: three slides in arabic numbering, then two slides in alph, then two slides in arabic, then three slides in roman, etc.

Is it possible?

Best Answer

The number of the current frame is contained in the counter

framenumber

which is output by the command

\theframenumber

Unless you don't want to write wrapper code for frames with arabic, alph or roman 'numbering', you have to redefine the \theframenumber command each time you want to have a specific numbering.

\renewcommand{\theframenumber}{\alph{framenumber}} % for lower case letters
\renewcommand{\theframenumber}{\arabic{framenumber}} % for arabic numbering
\renewcommand{\theframenumber}{\Roman{framenumber}} % for upcase roman numbering.

Don't forget to set the framenumber counter to zero, if you want to restart the counting, unless you prefer, say, frame 5 followed by 'F' etc.

For future use wrapper environments with an optional [framenumberstyle=Roman] etc. would help.

Here is a MWE in which I omitted any further feature of the beamer class and did reset the counter.

\documentclass{beamer}

\begin{document}

%%% Now upper case ('Alph')  numbering
\renewcommand{\theframenumber}{\Alph{framenumber}}

\begin{frame}[label=first]{Frame Number One with upper case numbering}
This is frame number \theframenumber
\end{frame}

 \begin{frame}[label=second_alph]{Frame Number Two with upper case numbering}
This is frame number \theframenumber
\end{frame}

%%% Now arabic numbering

\renewcommand{\theframenumber}{\arabic{framenumber}}
\begin{frame}[label=first_arabic]{Frame Number Three with arabic numbering}

This is frame number \theframenumber
\end{frame}

%%% Now Roman numbering
\renewcommand{\theframenumber}{\Roman{framenumber}}
\begin{frame}[label=first_roman]{Frame Number Four with roman numbering}

This is frame number \theframenumber
\end{frame}


\begin{frame}[label=second_roman]{Frame Number Five with roman numbering}
This is frame number \theframenumber

\end{frame}

\end{document}% End

Edit 2015/01/02

Some themes use the outer theme infoline which uses a 'frame number/totalframenumber' output in the lower right part.

The frame number is inserted by \insertframenumber, which itself is

\arabic{framenumber}

so this has to be changed to another counting format (at will)

To get rid of the total frame number it's necessary to change the beamer template footline after the line

\usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}

The spacing command after \insertframenumber is deliberately used (change to appropiate values)

\renewcommand{\insertframenumber}{\Roman{framenumber}} % Upper case roman numbers

\makeatletter
\defbeamertemplate*{footline}{patched infolines theme}
{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
    \rlap{\insertframenumber} \hspace*{1ex}%
    \hspace*{2ex} 
  \end{beamercolorbox}}%
  \vskip0pt%
}
\makeatother