Referencing Equations

Is there a way to give equations/math latex text an equation number and make it reference-able?

Use the following construction:

$$e=mc^2 \tag{1}\label{name}$$

You can now refer to this formula:

$$\eqref{name}$$

This is really interesting!

Thank you!

I slightly upgrade it: using $\eqref{eq1}$ so that the equation label can be refereed inline.

$$e=mc^2 \tag{1} \label{eq1}$$

Einstein provides $\eqref{eq1}$ in his paper.

In case someone runs into this question, please note that this does not work anymore due to an upstream bug. For more info see: Automatic equation numbering (Latex Math) - #27 by WhiteNoise