17 January 2013

Equation numbering in LaTeX: several versions of the same formula

When deducing a result one might need to write a formula several times, in slightly different form, as the proof proceeds. Using different equation numbers (default LaTeX behaviour) fails to show the unity between the various expressions. On the other hand, using only the \tag{} keyword (defined in the amsmath package) sets them completely apart from the other equations in the sequence.

It took me some time to realize that these two approaches can be combined very easily, as shown below:
 \documentclass{article} \usepackage{amsmath} \begin{document} E=ma^2 \label{energy} a = b E=mb^2 \tag{\ref{energy}bis} b = c E=mc^2 \tag{\ref{energy}ter} \end{document} 
yielding the desired result:

E=ma^2
\label{energy}

a = b

E=mb^2
\tag{\ref{energy}bis}

b = c

E=mc^2
\tag{\ref{energy}ter}