1

How can I reference to the equations in the alignat? The equation set is

\begin{alignat}{2}
 \sigma_1 &= x + y  &\quad \sigma_2 &= \frac{x}{y} \\  
 \sigma_1' &= \frac{\partial x + y}{\partial x} & \sigma_2'
    &= \frac{\partial \frac{x}{y}}{\partial x}
\end{alignat}

Now in my text I want to refer like this

As you can see, \ref{equation1} is above \ref{equation2}!
  • 3
    Add a unique \label{} to each line of the equation. – Steven B. Segletes Dec 20 '14 at 19:35
  • qnd you may want to use \eqref instead of just \ref. – barbara beeton Dec 20 '14 at 20:11
3

We would use \label{labelname} on a line (before the \\ command) to label a particular line. It is conventional to use the \eqref command in order to automatically wrap the reference with parentheses.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsthm,amssymb,mathtools}

\begin{document}

\begin{alignat}{2}
\sigma_1 &= x + y  &\quad \sigma_2 &= \frac{x}{y} \label{equation1}\\  
\sigma_1' &= \frac{\partial x + y}{\partial x} & \sigma_2'
     &= \frac{\partial \frac{x}{y}}{\partial x} \label{equation2}
\end{alignat}

As you can see, \eqref{equation1} is above \eqref{equation2}!
\end{document}

Since labels are not 'typed', it is also conventional to precede the label by eq: in order to indicate the label is an equation label. For example, we would use \label{eq:equation1} and \eqref{eq:equation1} or something to that effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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