LaTeX之罗列多个公式

一、gather的用法

基本用法,公式编号

\begin{gather}
a+b = b+a \\
a\times b = b \times a
\end{gather}

a + b = b + a a × b = b × a \begin{gather} a+b = b+a \\ a\times b = b \times a \end{gather} a+b=b+aa×b=b×a
可以使用gather*不编号

\begin{gather*}
a+b = b+a \\
a\times b = b \times a
\end{gather*}

a + b = b + a a × b = b × a \begin{gather*} a+b = b+a \\ a\times b = b \times a \end{gather*} a+b=b+aa×b=b×a
或者在\\前用\notag命令阻止指定的行不编号,
a + b = b + a a × b = b × a a − b = − b + a \begin{gather} a+b = b+a \notag \\ a\times b = b \times a \notag \\ a-b=-b+a \\ \end{gather} a+b=b+aa×b=b×aab=b+a

二、align环境

gather环境中每行公式是剧中的,而align可以按照等号或其它关系符对齐

\begin{align}
a+b &= b+a \\
a\times b  + 1 &= b \times a + 1
\end{align}

a + b = b + a a × b + 1 = b × a + 1 \begin{align} a+b &= b+a \\ a\times b + 1 &= b \times a + 1 \end{align} a+ba×b+1=b+a=b×a+1

三、 alignat环境

alignat环境通过手动增加间距,有一个参数,表示每行要对齐的公式个数,每两列一组,例如把列间隔设定为一个\quad,即1em.

\begin{alignat}{2}
x &= \sin t & \quad & \text{水平方向} \\
y &= \cos t && \text{垂直方向}
\end{alignat}

x = sin ⁡ t 水平方向 y = cos ⁡ t 垂直方向 \begin{alignat}{2} x &= \sin t & \quad & \text{水平方向} \\ y &= \cos t && \text{垂直方向} \end{alignat} xy=sint=cost水平方向垂直方向

四、cases环境

将几行公式前面用花括号括起来

\begin{equation}
f(x) = \begin{cases}
1, & \text{if } x \in [0, 1]; \\
0, & \text{if } x \in [-1, 0).
\end{cases}
\end{equation}

f ( x ) = { 1 , if  x ∈ [ 0 , 1 ] ; 0 , if  x ∈ [ − 1 , 0 ) . \begin{equation} f(x) = \begin{cases} 1, & \text{if } x \in [0, 1]; \\ 0, & \text{if } x \in [-1, 0). \end{cases} \end{equation} f(x)={1,0,if x[0,1];if x[1,0).

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值