[Tex/LaTex] Update references and labels of equations after changing the order

chapterscross-referencingequationsnumbering

This seems again trivial, but I cannot find any solution to my problem in the questions that have been asked on referencing.

The issue can be explained easily: I am making a document with many equations which are numbered consecutively. All of them are labelled (manually) via \label and referenced via \ref.
Now let's say I decide to move one of the equations at the beginning of the document to the Appendix. This makes all of the following labels and references too large by exactly 1.
I cannot believe I have to edit all of them manually? I mean it's possible if you make all the references at the end of your work, but still I wonder if there is a more effective way.

Best Answer

I like to label my equations eq1, eq2 etc. in order to remember them (especially if I come back after a delay). A partial solution is to use the following:

\documentclass{article}
\usepackage{mathtools}

\newcounter{myeqn}
\newcommand{\eqlabel}{
\stepcounter{myeqn}
\label{eq\arabic{myeqn}}
}

\begin{document}

\begin{equation}
\eqlabel
A=A
\end{equation}

\begin{equation}
\eqlabel
A\neq B
\end{equation}

If one substitues for $A$ using (\ref{eq1}) into (\ref{eq2})
\end{document}

Of course, the references occur randomly and still have to be edited manually. Then again, I avoid autonumbering in general (it's easier to add than remove).