1

This question already has an answer here:

\documentclass{article} 

\newcommand{\dd}[1]{\mathrm{d}#1}

\begin{document}
\begin{equation}
\Delta A_2 = x^2
\end{equation}

This code puts a (1) next to this equation, and numbers later equations accordingly. If I want to reference this equation, say with:

And as you can see in Eq. #, 

how would I link it so that if the equation number later changes, I don't have to update the text?

marked as duplicate by CarLaTeX, Troy, Circumscribe, Phelype Oleinik, Mensch Dec 5 '18 at 19:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

You can simply use \label{...} within the equation environment and \ref{...} to refer to it.

For more info, see here: https://en.wikibooks.org/wiki/LaTeX/Labels_and_Cross-referencing.

And remember to compile twice, the first time you'll get ?? instead of the ref.no., but don't worry, it's normal, the second time you'll get the correct number.

\documentclass{article} 

\begin{document}
Equation \ref{eq:myeq} blah blah blah
\begin{equation}\label{eq:myeq}
\Delta A_2 = x^2
\end{equation}
\end{document}

enter image description here

If you add another equation, LaTeX will manage the numbering:

\documentclass{article} 

\begin{document}
If I add another equation \ref{eq:myneweq},  \LaTeX{} will manage the numbering. 
\begin{equation}\label{eq:myneweq}
\Delta A_1 = x
\end{equation}
Equation \ref{eq:myeq} blah blah blah
\begin{equation}\label{eq:myeq}
\Delta A_2 = x^2
\end{equation}
\end{document}

enter image description here

  • This does not provide automatic numbering though. I don't want to manually label every equation. What if I decide to add an equation at the beginning? Then all the numbering is messed up. – Jackson Hart Dec 5 '18 at 18:02
  • @Ben No, ben LaTeX will do it for you – CarLaTeX Dec 5 '18 at 18:04
  • @Ben See my second example, you only have to put the alphabetical labels, LaTeX will do the correct numbering (compiling twice). – CarLaTeX Dec 5 '18 at 18:10
  • @Ben This is one of the wonderful things LaTeX does for you :) – CarLaTeX Dec 5 '18 at 18:10
1

You can just add \label{yourlabel} after \begin{equation}:

\begin{equation}\label{equ1}
  • This does not provide automatic numbering though. I don't want to manually label every equation. What if I decide to add an equation at the beginning? Then all the numbering is messed up. – Jackson Hart Dec 5 '18 at 18:02
  • @aquila: Your answer is somewhat incomplete: while you illustrate how a label should be inserted, you do not show how it can be referenced. – Circumscribe Dec 5 '18 at 19:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.