Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The following LaTeX document:

\documentclass{article}

\usepackage{amsmath}
\begin{document}
\begin{align}
  E=mc^2 \\ \nonumber
  E=mc^2 \label{eq1}
\end{align}

ref \ref{eq1}
\end{document}

Does not display the reference \ref{eq1}. Why?

share|improve this question

2 Answers 2

up vote 9 down vote accepted

The \label is on the same equation line (not code line) as the \nonumber and therefore doesn't get any equation number to label and to reference later. You need to move \nonumber (or the \label) before the \\:

\documentclass{article}

\usepackage{amsmath}
\begin{document}
\begin{align}
  E=mc^2 \nonumber \\
  E=mc^2 \label{eq1}
\end{align}

ref \ref{eq1}
\end{document}

In the above case the equation number is placed in the second row. If you want it in the first then place the \nonumber after the \\ but the \label before it.

share|improve this answer

use it this way:

\begin{align}
  E=mc^2 \nonumber\\ 
  E=mc^2 \label{eq1}
\end{align}

ref \ref{eq1}

Set \nonumber before the double backslash

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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