5

How to create figure numbers like 1.1.1 and then 1.2.1, not 1.2.2? I mean even if I added \arabic{section} into the command, the order of figures is still continuous, not accordingly rearranged by sections. Is there any mistake I made? Below is the command line:

\renewcommand{\thefigure}{\arabic{chapter}.\arabic{section}.\arabic{figure}}
lockstep
  • 250,273
  • Can you give more detail about what the numbers refer to . In '1.2.1' I guess the first number is the chapter. What about the other two? – Joseph Wright Aug 28 '10 at 05:30

2 Answers2

8

For numbering figures and tables per chapter you could use the command \numberwithin of amsmath:

\usepackage{amsmath}
\numberwithin{figure}{section}
\numberwithin{table}{section}

amsmath is very recommendable if you write mathematical expressions in your document.

Alternatively, use the package chngcntr which is specialized in such manipulations of counters:

\usepackage{chngcntr}
\counterwithin{figure}{section}
\counterwithin{table}{section}
Stefan Kottwitz
  • 231,401
1

We solved this by using the following piece of code

\numberwithin{figure}{section}
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{section}.\arabic{figure}}

Make sure to place the \numberwithin command before the renewcommand snippet, otherwise it won't work.