1. gather
Usage
Basic usage, formula number
\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×agather*
No number can be used
\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
Or use the command \\
before \notag
to prevent the specified line from being numbered,
a + b = b + aa × b = b × aa − b = − b + a \begin{gather} a+b = b+a \notag \\ a\ times b = b \times a \notag \\ ab=-b+a \\ \end{gather}a+b=b+aa×b=b×aa−b=−b+a
2. align
Environment
gather
Each line of formula in the environment is in-play, and align
can be aligned according to the equal sign or other relational symbols
\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
3. alignat
Environment
alignat
The environment increases the spacing manually, and there is a parameter that indicates the number of formulas to be aligned in each row, in groups of two columns. For example, set the column spacing to one, which is \quad
1em.
\begin{alignat}{2}
x &= \sin t & \quad & \text{水平方向} \\
y &= \cos t && \text{垂直方向}
\end{alignat}
x = sin t horizontal direction y = cos t vertical direction \begin{alignat}{2} x &= \sin t & \quad & \text{horizontal direction} \\ y &= \cos t && \text{ vertical direction} \end{alignat}xy=sint=costhorizontal directionVertical
4. cases
Environment
Enclose several lines of formulas in curly braces
\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).