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.

I don't actually have a real problem, but I'd like to understand why beamer requires multiple compilations to get the slide count right.

I'm writing a presentation, so I often add a new frame, write something, and then compile the presentation to see how it looks. But every time a new frame is added the total number of slides isn't updated, so the last slide shows a n+1/n label instead of n+1/n+1 as I'd expect(where n is the previous number of slides).

I've tried to search a bit but I couldn't find anything mentioning this behaviour.

Is this supposed to be the normal behaviour?

edit: I can reproduce this by doing the following steps:

  1. Create a random beamer presentation(using a style that shows the slide count e.g. AnnArbor) with one frame
  2. Compile it
  3. Add a new frame
  4. Compile again and the last slide will show the described behaviour.
share|improve this question

1 Answer 1

up vote 8 down vote accepted

The number of last slide is only known when the last slide is produced (TeX reads your input from start to finish, creating pages as it goes). beamer writes this information to the .aux file as part of the 'tidy up' after the last output page is produced (at \end{document}). On the next run, this information is read back before the first page is produced (at \begin{document}), and is 'read only' during the page creation process. When the number of slides changes, the previous number is used during the typesetting process as that's what was read in. Thus you always need a second run to account correctly for a new slide. (The same is true for many other LaTeX values, for example cross-references, the number of the last page, ...).

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.