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.
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).
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With