gogoWebsite

latex formulas, numbering, alignment

Updated to 4 months ago
There are two types of math formulas in LaTeX, formulas in rows and stand-alone formulas. In-line formulas are placed in the middle of the text, and stand-alone formulas are on a separate line.

(1) Equations in rowsIt can be expressed in these three ways as follows:
\begin{math}x^n+y^n=z^n\end{math},
or
\(x^n+y^n=z^n\),
or
$x^n+y^n=z^n$。

(2) will automatically form a separate lineindependent formulaIt can be expressed in the following three ways:
\begin{displaymath}
x^n+y^n=z^n
\end{displaymath}

No automatic numbering
\[x^n+y^n=z^n\] 

manual numbering
$$x^n+y^n=z^n$$
This format also allows you to specify the formula'sManual numbering
$$x^n+y^n=z^n \eqno{(1)}$$

auto-numbering
\begin{equation}
x^n+y^n=z^n
\end{equation}

quoteYou can just use $number$ when you want.
For example, $$a^2+b^2=c^2 /eqno (**)$$
The conclusion can be obtained from the formula ($**$).
In general, the interlinear formula $$...$$ can also be expressed as /[.../]
However, for such manually numbered formulas, one cannot use /[... /] instead of $$...$$.

Single formula line feed
When a single formula is very long and requires a line break, but only allows the generation of a number, you can use the split command
/begin{equation}
/begin{split}
a &= b //
c &= d
/end{split}
/end{equation}
Note: Only one "&" is allowed on each line. After using the split command, the number will be centered at the top and bottom.

(3)Separate formulas with multiple lines, which can be written in the following way:
begin{eqnarray}
left & center & right//
left & center & right//

/end{eqnarray}
For example:
\begin{eqnarray*}
x^n+y^n & = & z^n \\
x+y & = & z
\end{eqnarray*}
The environment of the formula for multi-line each line is added to the automatic numbering, if relative to a line is not added to the number, you can add a new line before the command /nonumber.
Where between the two & signs is the position of the alignment between formulas, with // separating the lines of formulas. Changing eqnarray to eqnarray* outputs formulas that are unnumbered.
If you want to change the automatic numbering of formulas, you can reset the initial value of the counter:
/setcounter{equation}{count}
The next number is automatically added 1.

(4) Multiple formulas(e.g., systems of equations) Each formula is automatically numbered.
1) Gather Environment
is a special case of the align environment below.
/begin{gather}
a &= b //
c &= d //

/end{gather}
>>1. If some of these lines use the same number, you need to embed a split environment.
>> 2. Command /notag can make the current line is not numbered.
2) align environment
Several groups of formulas can be made side by side, i.e., multiple formulas can be displayed on the same line, by using the same "&" alignment as before.
An alternative to the GATHER environment.
3) /gathered,/aligned.. The above environments for groups of equations will take up a full line, no matter how small each formula is. With the corresponding /gathered, /aligned environments, only the actual width of the formula is taken up, and the whole is treated as an extra-large symbol along with the others.
This structure can also add positional parameters to determine vertical alignment with other symbols (b,t). And this environment no longer has automatic numbering.

Example:
/begin{equation}
/left.
/begin{aligned}[b]
a &= b+c //
d &= b+c
/end{aligned}
/right/}
/Longrightarrow
/qquad a=d