# using subequations

I have an equation consisting of two parts and would like to use subequation for that. Here's the code:

\usepackage{amsmath}

\begin{subequations}
$$\operatorname{min}_{a,b,c} \frac{1}{2}\mathbf{w}^{T}\mathbf{w} + C \sum_{i=1}^{l}\xi_{i}$$
$$y_{i}\left(\mathbf{w}^{T}\phi(x_{i})+b\right)$$

\end{subequations}


I'm getting an error:

final.tex:118:Missing $inserted. final.tex:118:Display math should end with$\$.


Can anybody help with that?

Paragraph breaks (which are produced by empty lines, too) don't quite work in math mode. Once you remove the empty line, the code compiles fine:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{subequations}
$$\operatorname{min}_{a,b,c} \frac{1}{2}\mathbf{w}^{T}\mathbf{w} + C \sum_{i=1}^{l}\xi_{i}$$
$$y_{i}\left(\mathbf{w}^{T}\phi(x_{i})+b\right)$$
\end{subequations}

\end{document}

• Thank you for a swift answer. I have spent two hours on looking for this error and found it by myself minute I posted my question here. – matcheek Mar 22 '11 at 8:09
• BTW: use \min instead of \operatorname{min}, and it might be an idea to use the bm package and its \bm command for bold letters, then one gets bold italic not bold upright – daleif Mar 22 '11 at 10:05
• another suggestion: instead of separate equations within subequations, it's generally better to use one of the amsmath multi-line display structures; in this instance i'd suggest gather. separate equations may not be spaced well vertically, and can break across pages. – barbara beeton Mar 22 '11 at 12:39
• There is a good example of how to do this in the `Short Math Guide to LaTeX'. – erik Nov 17 '13 at 20:26