[Tex/LaTex] Suppress output of slide numbers for slides without number for Beamer

beamer

There is a question about how not to number some slides: Beamer: \nonumber equivalent for slides?

However the slides themselves still have their number printed.
How can I suppress output of that as well?

MWE:

\documentclass{beamer}

\usetheme{Dresden} 

\setbeamertemplate{footline}[frame number]{}

\begin{document}

%do not want slide number here
\begin{frame}[noframenumbering]
 \titlepage 
\end{frame}

\begin{frame}
Some actual content here
\end{frame}

%and here
\begin{frame}[noframenumbering]
{\Huge Section 2}
\end{frame}

\begin{frame}
Some more actual content here
\end{frame}

%and possibly on 20 more slides 
%without specifying format for each of special slides
%every time

\end{document}

Best Answer

There are basically three options, how to get rid of the framenumbers:

  1. remove head- and footline via:
\begin{frame}[noframenumbering, plain]...
  1. temporarily clear the footline
 { \setbeamertemplate{footline}{} \begin{frame}[noframenumbering] \titlepage \end{frame} }
  1. temporarily redefining the footline

This heavily depends on the used outer theme. With \setbeamertemplate{footline}[frame number]{} used in the MWE this brings no advantage compared to option 2.


To make this automatic for a large number of frames, one can define custom keys. The following example illustrates, how this could work with option 2.:

\documentclass{beamer}
\usetheme{Dresden}

\usepackage{etoolbox}

\defbeamertemplate{footline}{nonum}{%
    \addtocounter{framenumber}{-1}
}

\BeforeBeginEnvironment{frame}{%
\setbeamertemplate{footline}[frame number]{}
}

\makeatletter
\define@key{beamerframe}{nonum}[true]{%
    \setbeamertemplate{footline}[nonum]%
}
\makeatother

\begin{document}

    \begin{frame}[nonum]
        Removeframenumber
    \end{frame}

    \begin{frame}
        normal frame
    \end{frame}

\end{document}