number several equations with only one number

前端 未结 2 1081
深忆病人
深忆病人 2021-01-30 10:37

How can I number several equations in a align environment using only one number?

For example

\\begin{align}
w^T x_i + b \\geqslant 1-\\xi_i \\text{ if }         


        
2条回答
  •  囚心锁ツ
    2021-01-30 11:20

    First of all, you probably don't want the align environment if you have only one column of equations. In fact, your example is probably best with the cases environment. But to answer your question directly, used the aligned environment within equation - this way the outside environment gives the number:

    \begin{equation}
      \begin{aligned}
      w^T x_i + b &\geq 1-\xi_i &\text{ if }& y_i=1,  \\
      w^T x_i + b &\leq -1+\xi_i & \text{ if } &y_i=-1,
      \end{aligned}
    \end{equation}
    

    The documentation of the amsmath package explains this and more.

提交回复
热议问题