LaTeX \LaTeX LATEX 公式编号
单行公式:
$$
\begin{equation}
f(x) = x^2 + 2x + 1
\end{equation}
$$
f ( x ) = x 2 + 2 x + 1 \begin{equation} f(x) = x^2 + 2x + 1 \end{equation} f(x)=x2+2x+1
多行公式分别编号:
$$
\begin{align}
f(x) &= x^2 + 2x + 1 \\
g(x) &= \sin(x) + \cos(x)
\end{align}
$$
$$
\begin{align}
f(x) &= a + b \\
&= \alpha + \beta
\end{align}
$$
f ( x ) = x 2 + 2 x + 1 g ( x ) = sin ( x ) + cos ( x ) \begin{align} f(x) &= x^2 + 2x + 1 \\ g(x) &= \sin(x) + \cos(x) \end{align} f(x)g(x)=x2+2x+1=sin(x)+cos(x)
f ( x ) = a + b = α + β \begin{align} f(x) &= a + b \\ &= \alpha + \beta \end{align} f(x)=a+b=α+β
多行公式只占用一个编号:
$$
\begin{equation}
\begin{aligned}
f(x) &= x^2 + 2x + 1 \\
g(x) &= \sin(x) + \cos(x)
\end{aligned}
\end{equation}
$$
$$
\begin{equation}
\begin{align*} 注:*表示不编号
f(x) &= a + b \\
&= \alpha + \beta
\end{align*}
\end{equation}
$$
f ( x ) = x 2 + 2 x + 1 g ( x ) = sin ( x ) + cos ( x ) \begin{equation} \begin{aligned} f(x) &= x^2 + 2x + 1 \\ g(x) &= \sin(x) + \cos(x) \end{aligned} \end{equation} f(x)g(x)=x2+2x+1=sin(x)+cos(x)
f ( x ) = a + b = α + β \begin{equation} \begin{align*} f(x) &= a + b \\ &= \alpha + \beta \end{align*} \end{equation} f(x)=a+b=α+β
手动指定编号:
$$
\begin{equation}
f(x) = x^2 + 2x + 1
\tag{编号} 注:tag优先级大于equation和align
\end{equation}
$$
$$
\begin{align}
f(x) &= a + b
\tag{编号}
\end{align}
$$
f ( x ) = x 2 + 2 x + 1 \begin{equation} f(x) = x^2 + 2x + 1 \tag{编号} \end{equation} f(x)=x2+2x+1(编号)
f ( x ) = a + b \begin{align} f(x) &= a + b \tag{编号} \end{align} f(x)=a+b(编号)