98

I prepare some backup slides at the end of my presentation. I don't want them to be counted in terms of pages, which is displayed at the footer of each slide.

Does anyone know how to do that?

4
  • 3
    Does this post answer your question: stackoverflow.com/questions/732902/… ?
    – Corentin
    Sep 6, 2012 at 16:33
  • Surely I misunderstood the question, but if you have just backup slides to not show... why not just put before an extra \end{document}? For see again the backups the only thing needed is put % before.
    – Fran
    Sep 6, 2012 at 17:18
  • 3
    @Fran as I understand the question, SoftTimur do want those frames to appear, he just doesn't want them to be taken into account when calculating the total number of frames/slides. Sep 6, 2012 at 17:55
  • See also tex.stackexchange.com/q/2541/35864.
    – moewe
    Jun 7 at 19:06

4 Answers 4

96

For the sake of completeness, here are two solutions inspired from the link given in my above comment.

  1. You can define a new counter at the end of your presentation, before your backup slides, and use this counter at the end of your backup slides to fool beamer on the total number of slides. Here is a MWE:

    \documentclass{beamer}
    
    \usepackage{beamerthemesplit}
    \usepackage{lipsum}
    \usetheme{Madrid}
    
    \newcommand{\backupbegin}{
       \newcounter{finalframe}
       \setcounter{finalframe}{\value{framenumber}}
    }
    \newcommand{\backupend}{
       \setcounter{framenumber}{\value{finalframe}}
    }
    
    \begin{document}
    % Your normal slides go here 
    \frame{\lipsum[1]}
    \frame{\lipsum[2]}
    
    \appendix
    \backupbegin
    % And your backup slides here
    \frame{\lipsum[3]}
    \backupend
    
    \end{document}
    

    In this case, the backup slide is numbered as 3/2 in this example.

  2. Alternatively, you can use the appendixnumberbeamer package. MWE:

    \documentclass{beamer}
    
    \usepackage{beamerthemesplit}
    \usepackage{lipsum}
    \usetheme{Madrid}
    \usepackage{appendixnumberbeamer}
    
    \begin{document}
    % Your normal slides go here 
    \frame{\lipsum[1]}
    \frame{\lipsum[2]}
    
    \appendix
    % And your backup slides here
    \frame{\lipsum[3]}
    
    \end{document}
    

    In this case, the backup slide is numbered as 1/1.

2
  • 2
    For the second proposal, the displayed total number of slides is equal to the number of (normal+backup), instead of (normal) only. e.g. the entire presentation has 10 slides, 7 normal and 3 backup. At the 7th slide (which is normal), the displayed number is 7/10 instead of 7/7. Jul 19, 2017 at 9:20
  • 4
    Compile twice, this will give you 7/7 May 15, 2019 at 8:56
8

As of this post, beamer includes \insertmainframenumber. Unlike \inserttotalframenumber, \insertmainframenumber only counts slides before the appendix--no package dependencies, custom commands, or other tricks needed!

I know this is old, but this problem wasted hours of my life and I want to make sure anyone searching for this finds this solution quickly! I guess it pays to read the manual, but I was discouraged because it is so long and dense and I am not good at programming.

1
  • 2
    This is very nice. To clarify what this solution offers in contrast to the package appendixnumberbeamer in @Corentin's answer: \insertmainframenumber would normally be used in a beamertheme file. appendixnumberbeamer works without modifying a theme file. appendixnumberbeamer uses a separate total count in the appendix, while \insertmainframenumber carries over the total from the main slides. With the latter, if you have 20 main slides and 5 appendix slides, the last main slide will display 20/20, and the first appendix slide will display 21/20. Either might be desirable.
    – Mars
    Nov 12, 2022 at 5:44
7

Old question and already lots of beamer-only solutions, but an alternate solution could be to build separatly the main presentation and the backup set of slides, and stitch the two pdf files together with pdftk. This way they are guaranteed to have separate numbering.

To keep formatting the same, you can put all the header stuff in a separate file, then just \input it in the two latex files.

5

For themes based on the infolines outer theme and a beamer version >= 3.49 you can use \setbeamertemplate{page number in head/foot}[appendixframenumber] after your theme to exclude the appendix from framenumbers displayed on the bottom of the frame.

\documentclass{beamer}
\usetheme{Madrid}

\setbeamertemplate{page number in head/foot}[appendixframenumber]

\begin{document}
\begin{frame}
  \frametitle{First slide}
\end{frame}

\appendix

\begin{frame}
content...
\end{frame}

\end{document}

You must log in to answer this question.

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