LaTeX lists multiple formulas

1. gatherUsage

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×a
gather*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 \notagto 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×aab=b+a

2. alignEnvironment

gatherEach line of formula in the environment is in-play, and aligncan 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. alignatEnvironment

alignatThe 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 \quad1em.

\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. casesEnvironment

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).

Guess you like

Origin blog.csdn.net/mathlxj/article/details/131633248