TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing-up a lecture course in Latex with an essentially identical set of slides in beamer. I'd like to have the figure numbering in the beamer slides to match those of the lecture notes, for the sake of consistency in cross-referencing.

The lecture notes are written in the article document style (in particular there are no chapters), and have figures numbered by section (i.e. \section.\figure). Is there some simple preamble-trick or workaround that will change the way that the captions are produced in beamer to number them consistently with the lecture notes?

I'm trying to avoid having to write a new macro to use in the main body, since I'm compiling the notes and slides from the same set of source-files using \input.

share|improve this question
up vote 4 down vote accepted

It's actually very easy, though I had to read the manual for a while. Add these lines to your preamble:


The first line uses another template for captions, one that inserts the figure's number. Luckily this functionality is already built into beamer.

The second line declares that the figure counter is subordinate to the section counter, so resets for each new \section and labels figures 1.1, 1.2, ..., 2.1, 2.2, .... This is built into LaTeX.

That's it!

share|improve this answer

Your Answer


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.