0

I used the accepted answer from How to insert page number in Beamer Navigation Bars? to insert the page number in beamers navigation bar. But I am trying to exclude the page numbers from the appendix. The appendix is not counted as intended but it should just be one page saying something like “time for question” without any additional content (like page numbers). Even worse, in the current version I have to chose between a page number which is not correct or a page number that is bigger than the actual number of pages (if you remove [noframenumbering])

My minimum “working” example:

\documentclass[ignorenonframetext, ngerman]{beamer}
\usepackage{etoolbox} % for \newtoggle and \iftoggle

\usetheme{Frankfurt}

% see https://tex.stackexchange.com/questions/686/how-to-get-rid-of-navigation-symbols-in-beamer
\beamertemplatenavigationsymbolsempty

\newtoggle{inAppendix}
\newcommand{\myAppendix}{\appendix\toggletrue{inAppendix}}
% see https://tex.stackexchange.com/questions/137022/how-to-insert-page-number-in-beamer-navigation-bars (I modified this)
\addtobeamertemplate{navigation symbols}{}{
    \iftoggle{inAppendix}{}% do nothing in appendix
    {% add number of frame
        \usebeamerfont{footline}%
        \usebeamercolor[fg]{footline}%
        \hspace{1em}%
        \insertframenumber/\inserttotalframenumber
    }
}
\setbeamercolor{footline}{fg=black}

\title{Awesome project}
\author{Nomen nescio}

\begin{document}
    \frame{\titlepage}
    \frame{\tableofcontents[pausesections]}
    \section{Test}

    \begin{frame}
        Stuff!
    \end{frame}

    \myAppendix
    \begin{frame}[noframenumbering]
        \Huge
        Time for questions.
    \end{frame}
\end{document}}

My idea was to use a toggle for checking whether I have to add the page number. I tried replacing the toggle with a \newif\ifAppendix but it has nothing to do with it. I think I am checking the condition to late and the page number is already typeset when changing the value of the toggle.

What is happening in the background causing the toggle to have no effect? How can I get an output without page numbers in the appendix?

lockstep
  • 250,273
Bambino
  • 257

1 Answers1

3
\documentclass[ignorenonframetext, ngerman]{beamer}
\usetheme{Frankfurt}
\usepackage{appendixnumberbeamer}

\beamertemplatenavigationsymbolsempty
\addtobeamertemplate{navigation symbols}{}{
    \ifnum\insertframenumber>\inserttotalframenumber%
        \relax
    \else%
      \usebeamerfont{footline}%
    \usebeamercolor[fg]{footline}%
    \hspace{1em}%
    \insertframenumber/\inserttotalframenumber
  \fi%
}
\setbeamercolor{footline}{fg=black}

\title{Awesome project}
\author{Nomen nescio}

\begin{document}
    \frame{\titlepage}
    \frame{\tableofcontents[pausesections]}
    \section{Test}

    \begin{frame}
        Stuff!
    \end{frame}

    \appendix
    \begin{frame}
        \Huge
        Time for questions.
    \end{frame}
\end{document}

enter image description here


Starting with beamer version 3.49 the solution can be simplified to

\documentclass{beamer}
\usetheme{Frankfurt}

\makeatletter
\setbeamertemplate{navigation symbols}{
    \ifbeamer@inappendix%
  \else%
    \usebeamerfont{footline}%
        \usebeamercolor[fg]{footline}%
    \insertframenumber\,/\,\insertmainframenumber%
  \fi%
}
\makeatother

\begin{document}
    \section{Test}

    \begin{frame}
        Stuff!
    \end{frame}

    \appendix
    \begin{frame}
        \Huge
        Time for questions.
    \end{frame}
\end{document}