# Minimum width for beamer frame number

In certain beamer themes, the frame number is displayed as No./tot in the bottom right corner, following the date. Since the frame number is not constant in width, this makes the date “move” from frame to frame, and that bugs me. (With the default font, I see it only when the number of digits changes. But with the cabin font which I am using, I see the effect at every frame change.)

I didn't want go into defining my own footline, but I can force the frame number to take a fixed width with a simple redefinition, commented out in this MWE:

\documentclass{beamer}

\usepackage[sfdefault]{cabin} % this makes the effect worse

%% Proper formatting with:

\begin{document}
\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\end{document}


This solves the problem I described, but creates another (minor) one: The page number as displayed in a PDF viewer is screwed up (it reads, e.g., “[1em]1”).

To be sure, I can live with that. At this point I am asking more out of curiosity than to solve a practical problem. Is there a better way to achieve the desired effect?

Use

\let\ofn\insertframenumber
\texorpdfstring{\protect\makebox[1em]{\ofn}}{\ofn}%
}


so the box is used only for printing, while the naked number is used in the bookmarks.

Here's a possibly better idea:

\documentclass{beamer}

\usepackage[sfdefault]{cabin} % this makes the effect worse

\makeatletter
\defbeamertemplate*{footline}{infolines theme changed}
{
\leavevmode%
\hbox{%
\end{beamercolorbox}%
\end{beamercolorbox}%
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
%\setbeamertemplate{footline}[infolines theme changed]

\begin{document}
\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\begin{frame}{test}
\end{frame}

\end{document}