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.
Within the environment align
from the package amsmath
it is possible to combine the use of \label
and \tag
for each equation or line. For example, the code:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Write
\begin{align}
x+y\label{eq:eq1}\tag{Aa}\\
x+z\label{eq:eq2}\tag{Bb}\\
y-z\label{eq:eq3}\tag{Cc}\\
y-2z\nonumber
\end{align}
then cite \eqref{eq:eq1} and \eqref{eq:eq2} or \eqref{eq:eq3} separately.
\end{document}
produces:
\tag
also works in align*
. Example:
\begin{align*}
a(x)^{2} &= bx\tag{1}\\
a(x)^{2} &= b\tag{2}\\
ax &= b\tag{3}\\
a(x)^{2}+bx &= c\tag{4}\\
a(x)^{2}+c &= bx\tag{5}\\
a(x)^{2} &= bx+c\tag{6}\\ \\
Where\quad a, b, c \, \in N
\end{align*}
Output:
Usually my align environments are set up like
\begin{align}
\label{eqn1}
\lambda_i + \mu_i = 0 \\
\label{eqn2}
\mu_i \xi_i = 0 \\
\label{eqn3}
\lambda_i [y_i( w^T x_i + b) - 1 + \xi_i] = 0
\end{align}
The \label command should be placed in the line you want to reference, the placement in the line does not matter. I prefer to place it at the beginning at the line (as a sort of description) while others place them at the end.
The answers seem a bit dated, they don't work for me. What did work was
\begin{align}
1+1=2 \tag{xyz}
\end{align}
like this
\begin{align}
x_{\rm L} & = L \int{\cos\theta\left(\xi\right) d\xi}, \label{eq_1} \\\\
y_{\rm L} & = L \int{\sin\theta\left(\xi\right) d\xi}, \nonumber
\end{align}
Source: Stackoverflow.com