LaTeX Tip of the Day – equation numbering by section or chapter
March 11th, 2009
Let’s say you have a nice LaTeX document with sections, and it’s full of numbered equations. Normally, the equation numbers will start at 1 and keep counting up. If your document gets long, though, you may find yourself with hundreds of equations, and when a reader tries to look one up, they have to search around for a while.
To fix this problem, you can number your equations within sections (so the numbers will go (1.1), (1.2),…, (2.1),(2,2),… instead of (1),(2),…), just add
\usepackage{amsmath}
\numberwithin{equation}{section}
to the preamble of your document.
Of course, if you want numbering by chapter or subsection, just replace section with the relevant name.