# Ignore \pause but count \only in beamer for slide number

Beamer displays an excessive page number because it counts each \pause command as an extra page, which it technically is in the PDF but logically isn't.

Following an answer to a similar question, I tried \setbeamertemplate{footline}[frame number]{}, however that introduces the opposite problem of counting pages with the \only command only once, even though those are logically multiple slides.

Is there a way to ignore only \pause but still follow \only when counting page/frame numbers in the footline?

## Example

\documentclass{beamer}
\usepackage[utf8x]{inputenc}
\setbeamertemplate{footline}[frame number]

\begin{document}

\begin{frame}{Slide with Pause}
This should all be slide one.\\
One\pause{} Two\pause{} Three
\end{frame}

\begin{frame}{Slide with Only}
\only<1>{This should be page 2.}
\only<2>{This should be page 3.}
\end{frame}

\end{document}


If I use "page number", I get 5 pages. If I use "frame number", I get 2 pages. However I want to get 3 pages.

• Without see the code is impossible to know what are you doing wrong. In beamer there are page, slides and frames. If you use a theme like Madrid with 3 frames, each with two pauses, you will have a PDF with 9 pages and 3 frames with 3 slides each, and the counter go from 1/3 to 3/3, that is, counting frames, not slides nor pages.
– Fran
Nov 11 '20 at 10:09
• @Fran: I added an example. Nov 17 '20 at 9:29

The obvious solution: tell the truth

\begin{frame}{Slide without Only}
This should be page 2.
\end{frame}

\begin{frame}{Slide without Only}
This should be page 3.
\end{frame}


Full mwe:

\documentclass{beamer}
\usepackage{ulem}
\setbeamertemplate{footline}[frame number]
\begin{document}
\begin{frame}{Slide with Pause}
This should all be \sout{slide} frame \insertframenumber.\\
(page \insertpagenumber,  slide \insertslidenumber)\par\pause
(page \insertpagenumber,  slide \insertslidenumber)\par\pause
\end{frame}

\begin{frame}{Slide without Only}
This is the \sout{slide} frame \insertframenumber.
(page \insertpagenumber,  slide \insertslidenumber)
\end{frame}

\begin{frame}{Slide without Only}
(page \insertpagenumber,  slide \insertslidenumber)
\end{frame}
\end{document}


The unnecessary complicated solution: hide and lie

\begin{frame}{Slide with Only}
\only<1>{This should be page 2.}
\end{frame}


Full mwe:

\documentclass{beamer}
\usepackage{ulem}
\setbeamertemplate{footline}[frame number]
\begin{document}
\begin{frame}{Slide with Pause}
This should all be \sout{slide} frame \insertframenumber.\\
(page \insertpagenumber,  slide \insertslidenumber)\par\pause
(page \insertpagenumber,  slide \insertslidenumber)\par\pause
\end{frame}

\begin{frame}{Slide with Only}
\only<1>{This should be \sout{slide} frame \insertframenumber.
(but page in \insertpagenumber,  slide \insertslidenumber)}