« Birthday distribution | Main | RMatlab - Using R from Matlab! »

Appendix Slides in Beamer: Controlling frame numbers

A fellow student, Andrew Bradley, and I had a chat today about a feature missing from the beamer package in Latex: fine control over slide numbers.  We both subscribe to the philosophy that a each slide in a presentation should have a slide number and the total number of slides.  (An old professor strongly advocated this approach so that he could critique individual slides and had some idea of how much was left.)

Beamer makes it somewhat difficult to accommodate this system if you have backup slides in your presentation.  You know, those things you are supposed to have prepared in case you get one of the "hard" questions?  Anyway, these slides aren't a part of the standard presentation, and so they shouldn't count to the total slide number --- but they need to be there in your presentation file.

I had previously faced this issue and realized that you can just store and set the frame numbers in beamer at arbitrary points in the presentation.

% All your regular slides
% After your last numbered slide
\appendix
\newcounter{finalframe}
\setcounter{finalframe}{\value{framenumber}}
% Backup frames
\setcounter{framenumber}{\value{finalframe}}
\end{document}

However, Andrew wanted to go beyond just skipping backup slides and "uncount" the outline slides that appear at the beginning of a section, as well as the title slide.  He proposed using the trick above with the following adjustments.

1. Add \addtocounter{framenumber}{-1} on the \AtBeginSubsection frame
2. Add \setcounter{framenumber}{0} or \setcounter{framenumber}{1}
   to the \titlepage frame and/or the \tableofcontents frame
   depending on taste.

There you have it, all the tricks about frame counters in beamer that we know!

I suspect there is some way to accomplish the "backup" slides with a modification of the \appendix command and the \AtEndDocument directive.  My brief attempt at making these changes ended in failure and frustration.  Failure because it didn't work.  Frustration because I forgot to write down that it didn't work and didn't remember it the next time I wanted to use this feature.  (In fact, I really wish that beamer modified the \appendix command to implement precisely this feature.  What else would an appendix do in a presentation?)

TrackBack

TrackBack URL for this entry:
https://www.stanford.edu/~dgleich/cgi-bin/mt/mt-tb.cgi/23

Comments (1)

nicole taheri:

david,
you rock. i was trying to figure out how to do this and google sent me to your page. i'm so glad we're friends.

nicole

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on May 4, 2009 9:43 PM.

The previous post in this blog was Birthday distribution.

The next post in this blog is RMatlab - Using R from Matlab!.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34