# Add vertical strut to Beamer Metropolis' footer

The beamer theme metropolis includes an option to show frame numbers as a fraction of total frames. But it does not add a vertical strut for the eventuality that someone (me!!) would add additional text to the frame footer template. When comparing the numbered slides in the main document and the unnumbered in the appendix, then this causes the additional text to jump annoyingly. The jump is even more pronounced when I build the MWE with pdfLaTeX instead of with XeLaTeX as in the screenshot.

How would I go about to add the needed vertical strut to prevent the jumping? I know that I could add \setbeamertemplate{frame numbering}{\vphantom{/}} after \appendix, but I would really prefer to include the fix in the preamble rather than adding things in the document environment.

\documentclass{beamer}
\usetheme{metropolis}
\metroset{numbering=fraction}
\begin{document}
{
\setbeamertemplate{frame footer}{Some random text}
\begin{frame}[label=slide1]{Slide 1}
\end{frame}
}

\appendix

{
\setbeamertemplate{frame footer}{Some random text}
\begin{frame}[label=slide2]{Slide 2}
\end{frame}
}
\end{document}


This solution will remove the observed jump in the text, even when descenders are present.

LuaLateX using the Fira fonts

pdfLaTex using cm fonts

\documentclass{beamer}
\usetheme{metropolis}
\metroset{numbering=fraction}

\begin{document}
{%
\setbeamertemplate{frame footer}{Some random text (1)}
\begin{frame}[label=slide1]{Slide 1}
\end{frame}
}

\appendix

{%
\setbeamertemplate{frame footer}{Some random text 2}
\begin{frame}[label=slide2]{Slide 2}
\end{frame}
}

\end{document}

• Is the strut computed using \normalsize when \strut precedes \scriptsize? Jul 1, 2021 at 20:42
• @Fredrik P In the general case you are right. The right way is to use <fontsize>\strut. I updated the answer. In this case, when \strut precedes fontsize it happens to be generated for scriptsize, like the page number. The main point is to insert the same vertical space with depth, in the non apendix frames and in the appendix frames to eliminante their respective disalignment when the text lacks descenders. Notice how both texts move up, through a different distance to line up. Jul 1, 2021 at 22:06