4

I have the following code which works for counting pages:

\setbeamertemplate{navigation symbols}{
    \usebeamercolor[fg]{title}
    \hspace{1em}
    \large\insertframenumber/\inserttotalframenumber
}

added to the preamble.

I was wondering if I could add something so that when I cycle through a single frame it counts that too for example I would like the following to show:

1a/1 , 1b/1 , 1c/1 instead of 1/1 for all frames.

\documentclass[demo]{beamer}

\setbeamertemplate{navigation symbols}{
    \usebeamercolor[fg]{title}
    \hspace{1em}
    \large\insertframenumber/\inserttotalframenumber
}

\begin{document}

    \begin{frame}{Title}
        \begin{itemize}
            \item<1-> stuff
            \item<2-> stuff
            \item<3-> stuff
        \end{itemize}
    \end{frame}

\end{document}
evan54
  • 313
  • 3
  • 9

1 Answers1

4

Here's one possibility:

\documentclass[demo]{beamer}
\usepackage{tikz}

\makeatletter
\def\c@slideinframe{\beamer@slideinframe}
\def\beamerslideinframe{\beamer@slideinframe}
\makeatother

\addtobeamertemplate{frametitle}{}{%
\begin{tikzpicture}[remember picture,overlay]
  \node[inner sep=0pt,font=\large,anchor=south east] 
    at ([xshift=-0.5em]current page.south east)       
    {\insertframenumber-(\alph{slideinframe})/\inserttotalframenumber};%
\end{tikzpicture}
}
\setbeamertemplate{navigation symbols}{}

\begin{document}

    \begin{frame}{Title}
    \frametitle{Slide \arabic{slideinframe}}
        \begin{itemize}
            \item<1-> stuff
            \item<2-> stuff
            \item<3-> stuff
        \end{itemize}
    \end{frame}

\end{document}

The result:

enter image description here

The template in which to add the information about the slide number has to be carefully chosen; in some "late" templates (such as navigation symbols, footline) the value for the slide number gets affected by the overlays specification, so I had to use an "early" template such as frametitle and used TikZ to place the numbers in the desired location.

The code needs two or three runs to stabilize.

Gonzalo Medina
  • 505,128
  • hm... in some slides if I have a lot of text it throws it below the bottom of the slide, do you know why that may be? – evan54 Mar 07 '15 at 01:24
  • @evan54 I suspect the reason. Give me some minutes to fix this. – Gonzalo Medina Mar 07 '15 at 01:53
  • @evan54 please see my updated answer. Since some internal calculations are now used, the code needs two or three runs to stabilize – Gonzalo Medina Mar 07 '15 at 02:00
  • @GonzaloMedina Your solution works nicely – but unfortunately if a footer is used additionally (e.g. for displaying author and insitution) the manually added frame number is covered by the footer. Could the frame number be put in the foreground? – Pontis Dec 13 '21 at 18:29