Graphics, Figures & TablesAdvanced Numeration of Figures&Tables

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
an24
Posts: 3
Joined: Tue Aug 24, 2010 1:06 pm

Advanced Numeration of Figures&Tables

Post by an24 »

Please, can you help me with the problem.
Now I have the following automatic numeration:

Section 1
Figure 1
Figure 2

Section 2
Figure 3
Figure 4

Section 3
Figure 5
Figure 6

But I want:

Section 1
Figure 1.1
Figure 1.2

Section 2
Figure 2.1
Figure 2.2

Section 3
Figure 3.1
Figure 3.2

How can I achieve this?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10360
Joined: Mon Mar 10, 2008 9:44 pm

Advanced Numeration of Figures&Tables

Post by Stefan Kottwitz »

Hi an24,

welcome to the board!

If you're already using amsmath, you could achieve that by

Code: Select all

\numberwithin{figure}{section}
\numberwithin{table}{section}
Or use the cngcntr package:

Code: Select all

\usepackage{chngcntr}
\counterwithin{figure}{section}
\counterwithin{table}{section}
Or, especially if your document is large, consider to use a class like book or report (or scrbook, scrreprt, memoir) that provide chapters. Usually figures and tables would already be numbered in the desired way, per chapter.

Stefan
LaTeX.org admin
an24
Posts: 3
Joined: Tue Aug 24, 2010 1:06 pm

Re: Advanced Numeration of Figures&Tables

Post by an24 »

Thanks a lot! It works.
Post Reply