Ignoring page numbers in backup slides

前端 未结 9 1601
谎友^
谎友^ 2021-01-30 06:10

I am using the beamer document class in latex to make a presentation. I will have a number of back up slides which are there for offline viewing, reference etc. Beamer has a f

相关标签:
9条回答
  • 2021-01-30 07:08

    Just insert

    \renewcommand{\inserttotalframenumber}{\pageref{lastslide}}
    

    after \begin{document}, and place the marker

    \label{lastslide}
    

    on your last slide.

    0 讨论(0)
  • 2021-01-30 07:11

    Another possibility - which was recently added to beamer - is to use the appendixframenumber template:

    \documentclass[t]{beamer}
    
    \setbeamertemplate{footline}{
      \hfill%
      \usebeamercolor[fg]{page number in head/foot}%
      \usebeamerfont{page number in head/foot}%
      \setbeamertemplate{page number in head/foot}[appendixframenumber]%
      \usebeamertemplate*{page number in head/foot}\kern1em\vskip2pt%
    }
    
    \begin{document}
    
        \begin{frame}
            slide in the main part
            \only<2>{blub}
        \end{frame}
    
        \appendix
        \section*{Backup}
    
        \begin{frame}
            \frametitle{backup}
            not counting in the total frame number
        \end{frame}
    
    \end{document}
    
    0 讨论(0)
  • 2021-01-30 07:12

    I have defined two commands to do this:

    \newcommand{\beginbackup}{
       \newcounter{framenumbervorappendix}
       \setcounter{framenumbervorappendix}{\value{framenumber}}
    }
    \newcommand{\backupend}{
       \addtocounter{framenumbervorappendix}{-\value{framenumber}}
       \addtocounter{framenumber}{\value{framenumbervorappendix}} 
    }
    

    You can then use \beginbackup and \backupend before and after your backup slide to adjust the number of slides.

    For my beamer template I also like to add

    \setbeamertemplate{footline}{
      \leavevmode%
      \hbox{%
      \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
        \usebeamerfont{author in head/foot}\insertshortauthor~~(\insertshortinstitute)
      \end{beamercolorbox}%
      \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
        \usebeamerfont{title in head/foot}\insertshorttitle
      \end{beamercolorbox}%
      \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
        \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
        \insertframenumber{} \hspace*{2ex} % hier hat's sich geändert
      \end{beamercolorbox}}%
      \vskip0pt%
    }
    

    in the definition of the \beginbackup command to hide to total page number in the backup slides, otherwise you'll get something like "24/18".

    Using all this, your slides will be numbered like "x/Y" for all slides before the backup, where Y is the total number of slides before the first backup slide, and the backup slides will continue the numbering of the previous slides.

    0 讨论(0)
提交回复
热议问题