用一个数来编号几个方程 [英] number several equations with only one number

查看:72
本文介绍了用一个数来编号几个方程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在对齐环境中仅使用一个数字来编号几个方程?

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

例如

\begin{align}
w^T x_i + b \geqslant 1-\xi_i \text{ if } y_i=1, \nonumber \\
w^T x_i + b \leqslant -1+\xi_i \text{ if } y_i=-1,
\end{align}

编号将出现在第二个方程式的旁边。但是最好是出现在两个方程的直线之间。

The numbering will appear next to the second equation. But it would be better if it appears between the lines of the two equations.

在这种情况下,如何标记这组方程以供以后参考?

In this case how to label this group of equations for later referring to?

谢谢!

推荐答案

首先,您可能不想 align 环境,如果您只有一列方程式。实际上,在 cases 环境中,您的示例可能是最好的。但是要直接回答您的问题,请在等式中使用 aligned 环境-这样,外部环境给出的数字为:

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}

amsmath 软件包的文档对此进行了解释。

The documentation of the amsmath package explains this and more.

这篇关于用一个数来编号几个方程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆