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'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

1 Answer 1

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:

\setbeamertemplate{caption}[numbered]
\numberwithin{figure}{section}

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

 
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.