1

I want to have Roman page numbers (not frame numbers) in the appendix section both for the current and for the total page count, i.e. in the footline of my slides, I want:

1/4, 2/4, 3/4, 4/4
% appendix starts here
I/III, II/III, III/III

A similar thing has been asked in this question, but the total page count is missing in the appendix, i.e. it only gives I II III.

Here's my code:

% !TeX program = lualatex
\documentclass[aspectratio=169,t]{beamer}
\usetheme{Malmoe}
\usecolortheme{beaver}

\setbeamertemplate{navigation symbols}{}

% select page indicator style
\newcommand{\pagetracker}{%
    \insertpagenumber{} / \insertpresentationendpage%
}

\setbeamertemplate{footline}{
    \hfill\pagetracker\hspace*{1ex}
}

\usepackage{appendixnumberbeamer}

% switch to Roman numbering in appendix
\makeatletter
\g@addto@macro\appendix{
    \pagenumbering{Roman}
    \renewcommand*{\pagetracker}{%
        \insertpagenumber{} / \insertappendixendpage%
    }%
}%
\makeatother

\begin{document}
    
    \begin{frame}
        \only<1>{A1}
        \only<2>{A2}
    \end{frame}

    \begin{frame}
        \only<1>{B1}
        \only<2>{B2}
    \end{frame}

    \appendix
    
    \begin{frame}
        \only<1>{Appendix C1}
        \only<2>{Appendix C2}
    \end{frame}

    \begin{frame}
        \only<1>{Appendix D1}
        \only<2>{Appendix D2}
    \end{frame} 

    \begin{frame}
        \only<1>{Appendix E1}
        \only<2>{Appendix E2}
    \end{frame}
        
\end{document}
    

How can I convert the output of \insertappendixendpage to Roman to make this work?

1 Answer 1

1
% !TeX program = lualatex
\documentclass[aspectratio=169,t]{beamer}
\usetheme{Malmoe}
\usecolortheme{beaver}

\setbeamertemplate{navigation symbols}{}

% select page indicator style
\newcommand{\pagetracker}{%
    \insertpagenumber{} / \insertpresentationendpage%
}

\setbeamertemplate{footline}{
    \hfill\pagetracker\hspace*{1ex}
}

\usepackage{appendixnumberbeamer}

% switch to Roman numbering in appendix
\makeatletter
\g@addto@macro\appendix{
    \setcounter{page}{1}
    \renewcommand*{\pagetracker}{%
        \@Roman{\value{page}} / \@Roman{\beamer@endpageofdocument}%
    }%
}%
\makeatother

\begin{document}
    
    \begin{frame}
        \only<1>{A1}
        \only<2>{A2}
    \end{frame}

    \begin{frame}
        \only<1>{B1}
        \only<2>{B2}
    \end{frame}

    \appendix
    
    \begin{frame}
        \only<1>{Appendix C1}
        \only<2>{Appendix C2}
    \end{frame}

    \begin{frame}
        \only<1>{Appendix D1}
        \only<2>{Appendix D2}
    \end{frame} 

    \begin{frame}
        \only<1>{Appendix E1}
        \only<2>{Appendix E2}
    \end{frame}
        
\end{document}
    
4
  • Thank you, that is almost it! Any way to reset the page counter in the appendix so that the roman numbers count from I? Commented Mar 1, 2023 at 12:15
  • @Christoph90 see my edited answer Commented Mar 1, 2023 at 12:21
  • Thank you very much, it's perfect. Commented Mar 1, 2023 at 12:27
  • @Christoph90 You're welcome! Commented Mar 1, 2023 at 12:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .