I would like to reset equation numbering after each section or subsection. Right now I use
\setcounter{equation}{0}
I saw in another page you could also reset it by adding the following line to the preamble.
\numberwithin{equation}{subsection}
\renewcommand\theequation{\arabic{equation}}
But this doesn't seem to work. The equation counters just increment across subsections. It's the same across sections if we changed the preamble to
\numberwithin{equation}{section}
Best Answer
Tell LaTeX to reset the equation number whenever
section
orsubsection
is stepped:The instruction
\counterwithin*
is (almost) an interface to\@addtoreset
(which is better not used if a higher level command provided by a package is available). With\counterwithin
(without*
) the counter's representation would be changed, which isn't with the*
-form.