# problem with align* and labels

I have this code:

\begin{align*} \label{eq:svc2}
\stackrel{min}{\omega,b,\xi,\rho} \-\hspace{20pt} & \frac{1}{2}  \omega^T\omega - \nu \rho + \frac{1}{l} \sum_{i=1}^{l}{\xi_i} \\
\text{subject to} \-\hspace{20pt} & y_i(\omega^T\phi(x_i)+b) \geq \rho-\xi_i, \tag{eq:svc1}\\
& \xi_i \geq 0, i=1,...,l, \-\hspace{10pt} \rho \geq 0. \\
\end{align*}


I want to add a label for the entire equation, not one for each line.

How may I do it? I have tried \label nexto to \begin{align*} but a get an [warning: reference xxx on page xx undefined on input line xx] when referencing it using \ref

• By definition of the starred envs: they do not add equipment numbers, and btw: labels are to label some for later reference, it does not add the numbers. Replace align* by aligned, and wrap equation around that. This gives a single number plus alignment – daleif Mar 3 '16 at 18:29

Perhaps you're thinking to aligned:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\label{eq:svc2} \begin{aligned} \min_{\omega,b,\xi,\rho} \qquad & \frac{1}{2} \omega^T\omega - \nu \rho + \frac{1}{l} \sum_{i=1}^{l}\xi_i \\ \textup{subject to} \qquad & y_i(\omega^T\phi(x_i)+b) \geq \rho-\xi_i,\\ & \xi_i \geq 0, i=1,\dots,l, \quad \rho \geq 0. \end{aligned}

\end{document}


Note that \- makes no sense in math mode; also \min should be used and not \stackrel. For ... use \dots.