Categories
TeX and LyX

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.

By risna

a housewife who recently learns to knit and crochet, lives in Chiang Mai since 2007, so must learn Thai Language, and had some part time job to do documentation with LaTeX and welcoming for a new family member at the end of 2010

Leave a Reply

Your email address will not be published. Required fields are marked *