Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to label each equation in align environment?

I wonder how to label each equation in align environment? For example

\begin{align} \label{eq:lnnonspbb} \lambda_i + \mu_i = 0 \\ \mu_i \xi_i = 0 \\ \lambda_i [y_i( w^T x_i + b) - 1 + \xi_i] = 0 \end{align}  

only label the first equation and only the first equation can be referred later.

like image 374
Tim Avatar asked Apr 08 '10 11:04

Tim


People also ask

How do you reference multiple equations in LaTeX?

You can then use \cref{eq2,eq1,eq3,eq5,thm2,def1} in order to do it. Show activity on this post. The amsmath package introduces the subequations environment. The first label, 'all1', before the \begin{align} , creates a label for the complete set of equations (1, in this case).

How does align work in LaTeX?

Aligning Equations (align)The \\ tells LaTeX that you are finished with this line and are on to the next. Notice that there's no \\ on the last line; the \end{align*} tells LaTeX that you're finished. As you see above, you can leave some columns blank.


1 Answers

You can label each line separately, in your case:

\begin{align}   \lambda_i + \mu_i = 0 \label{eq:1}\\   \mu_i \xi_i = 0 \label{eq:2}\\   \lambda_i [y_i( w^T x_i + b) - 1 + \xi_i] = 0 \label{eq:3} \end{align}  

Note that this only works for AMS environments that are designed for multiple equations (as opposed to multiline single equations).

like image 172
Martijn Avatar answered Sep 27 '22 23:09

Martijn