TransWikia.com

Ignore pause but count only in beamer for slide number

TeX - LaTeX Asked on December 15, 2020

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{navigation symbols}{}
setbeamertemplate{footline}[frame number]

begin{document}

begin{frame}{Slide with Pause}                                                                                                                               
This should all be slide one.
Onepause{} Twopause{} 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.

One Answer

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{navigation symbols}{}
setbeamertemplate{footline}[frame number]
begin{document}
begin{frame}{Slide with Pause}
This should all be sout{slide} frame insertframenumber.
(page insertpagenumber,  slide insertslidenumber)parpause
(page insertpagenumber,  slide insertslidenumber)parpause
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}
This is sout{slide} frame insertframenumber.
(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.}
only<2>{addtocounter{framenumber}{1}This should be page 3.}
end{frame}

Full mwe:

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

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

Correct answer by Fran on December 15, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP