# How to reset numbering every new math block?

In a paper/document with multiple math blocks, such as align, equation etc. every new block resumes numbering from the number it was left in the previous. How can we reset the numbering, that is, how can each new math block within the same document start enumerating equations from 1?

• \setcounter{equation}{0} – Steven B. Segletes Aug 18 '15 at 15:13
• Sorry for asking, but why would you want this? This would potentially create hundreds of (1)'s making cross references unreadable. – daleif Aug 18 '15 at 15:27

Not sure what this is for.

The trick is to add \setcounter{equation}{0} to all the relevant structures.

\documentclass{article}
\usepackage{amsmath}
\usepackage{etoolbox}

\preto\equation{\setcounter{equation}{0}}
\makeatletter
\pretocmd\start@gather{\setcounter{equation}{0}}{}{}
\pretocmd\start@align{\setcounter{equation}{0}}{}{}
\pretocmd\start@multline{\setcounter{equation}{0}}{}{}
\makeatother

\begin{document}
First
$$0=0$$
Second
\begin{gather}
0=0\\
0=0\\$$0=0$$\end{gather}
Third
\begin{align}
0=0\\
0=0\\
0=0\\$$0=0$$\end{align}
Fourth
\begin{multline}
Aaaaaaaaaaaaaaaaaaaaaaaaaaa\\
bbbbbbbbbbbbbbbbbbbbbbbbbbb
\end{multline}

\end{document}