Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Consider the following beamer example below. Is it possible to adjust this, that Frame 4 has framenumber 3 on the handout (and not 4 in my example). In other words the numbering in the handout should be as the code of frame 3 would be commented out (and not just have the option ).

\documentclass[handout,gray]{beamer}
\usepackage[utf8]{inputenc}

\usepackage{pgfpages}
\pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm,landscape]

\setbeamertemplate{headline}{\scriptsize{\vspace*{0.3cm}\hspace*{0.3cm}\insertframenumber}}


\begin{document}


\begin{frame}
   \frametitle{Frame 1}
   Frame 1
\end{frame}

\begin{frame}<display:0>
   \frametitle{Frame 2}
   Frame 2
\end{frame}

\begin{frame}<handout:0>
   \frametitle{Frame 3}
   Frame 3
\end{frame}

\begin{frame}
   \frametitle{Frame 4}
   Frame 4
\end{frame}   
\end{document}

Frames

share|improve this question
    
I'm not sure I really understand. In your example, the numbers are hard-coded (not automatically generated) so you could do something like \alt<display>{4}{3} to put a 4 when in display mode and 3 otherwise (ie handout mode, though article would also get the 3). Would this help, or is the real case more complicated? –  Loop Space Mar 26 '12 at 19:57
    
@AndrewStacey The real example has a lot more frames and a lot more frames which should be skipped for the handout. So it's not a good idea to generate the framenumbers manually for the handout. Note that I don't need any numbers for display. I just want to have consecutive numbering for the handout frames (1,2,3,4,... without skipping a number though some frames are not on the handout). –  student Mar 27 '12 at 14:33

1 Answer 1

up vote 3 down vote accepted

Since beamer version 3.08, there is an undocumented option noframenumbering that doesn't increase the slide counter for the current frame. So if you want to exclude a single frame from the numeration and the handout, you can use

\begin{frame}<handout:0>[noframenumbering]
  ...
\end{frame}

To automate this, i. e. to exclude all the frame that aren't displayed in the current mode (handout, trans) from the numeration, you can patch the internal beamer command responsible for generating the frames:

\usepackage{etoolbox}
\makeatletter
\pretocmd{\beamer@@@@frame}{\alt<#1>{}{\beamer@noframenumberingtrue}}
\makeatother

Include this code somewhere in the preamble (that's between \documentclass{beamer} and \begin{document}) of your document. It uses the overlay command \alt to activate noframenumbering on every slide which isn't displayed.

Example code:

\documentclass[handout,gray]{beamer}
\usepackage[utf8]{inputenc}

\usepackage{pgfpages}
\pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm,landscape]

\setbeamertemplate{headline}{\scriptsize{\vspace*{0.3cm}\hspace*{0.3cm}\insertframenumber}}

% http://tex.stackexchange.com/a/49806/3323
\usepackage{etoolbox}
\makeatletter
\pretocmd{\beamer@@@@frame}{\alt<#1>{}{\beamer@noframenumberingtrue}}
\makeatother

\begin{document}
\begin{frame}
    Absolute frame number: 1\\
    Frame number in presentation: \insertframenumber
\end{frame}
\begin{frame}
    Absolute frame number: 2\\
    Frame number in presentation: \insertframenumber
\end{frame}
\begin{frame}<handout:0>
    Absolute frame number: 3\\
    Frame number in presentation: \insertframenumber
\end{frame}
\begin{frame}
    Absolute frame number: 4\\
    Frame number in presentation: \insertframenumber
\end{frame}
\end{document}

Result (click on the image to see it full-size):

output of the example handout with continuous frame numbering

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.