Jun 26

## Numbering for Tables, Figures and Equation

I have too many tables, figures and equation in my document. The default caption numbering is always increasing (so if I have 100 figures, then I would have caption Figures – 100). I want to restart numbering for each section so I can recognize which section the figures belong to.

Here how I change it.

In Latex Preamble (Or from LyX go to menu Document – Settings.. in tab Latex Preamble)

\renewcommand{\thefigure}{\thesection-\arabic{figure}}
\renewcommand{\thetable}{\arabic{section}.\arabic{table} }
\renewcommand{\theequation}{\thesection-\arabic{equation}}

And every new section, don’t forget to set the counter again to 1
\setcounter {figure}{0}
\setcounter{table}{0}
\setcounter{equation}{0}

I still don’t understand why I have to setcounter{0} if I want to start the counter from 1 again.

If your document type is chapter, you can change \thesection with \thechapter.