\[
E=mc^2
\]
\begin{equation} E=mc^2 \label{eq:energy} \end{equation}
多行公式有时候希望能够在特定的位置对齐,以下是其中一种处理方法。
\begin{align} P & = UI \& = I^2R \end{align}
|&| 是对齐的位置,|&| 可以有多个,但是每行的个数要相同。
\[ \mathbf{X} = \left( \begin{array}{cccc} x_{11} & x_{12} & \ldots & x_{1n}\ x_{21} & x_{22} & \ldots & x_{2n}\ \vdots & \vdots & \ddots & \vdots\ x_{n1} & x_{n2} & \ldots & x_{nn}\ \end{array} \right) \]
分段函数的表示:
\[ f(x) = \begin{cases} 0 & x \text{为无理数} ,\ 1 & x \text{为有理数} . \end{cases} \]
原文:https://www.cnblogs.com/ybl20000418/p/11477949.html