LaTeX 多行公式、公式对齐以及输入矩阵的方法

一、LaTex显示(大括号连接的)多行公式/公式组合

使用cases环境实现公式的组合,&分隔公式和条件,具体LaTex代码如下:

$$
D(x) = \begin{
    
    cases}
\lim \limits_{
    
    x \to 0} \frac{
    
    a^x}{
    
    b+c},&x<3 \\
\pi,&x=3\\
\int_a^{
    
    3b}x_{
    
    ij}+e^2dx,&x>3\\
\end{
    
    cases}
$$

公式显示如下:

D ( x ) = { lim ⁡ x → 0 a x b + c , x < 3 π , x = 3 ∫ a 3 b x i j + e 2 d x , x > 3 D(x)=\begin{cases} \lim \limits_{x \to 0} \frac{a^x}{b+c},&x<3 \\ \pi,&x=3\\ \int_a^{3b}x_{ij}+e^2dx,&x>3\\ \end{cases} D(x)=x0limb+cax,π,a3bxij+e2dx,x<3x=3x>3

二、LaTex显示多行公式且等号对齐

使用aligned环境实现公式的拆分,代码公式如下:

$$
\begin{
    
    aligned}
\cos 2x =\cos^2x - \sin^2x \\
=2\cos^2x-1
\end{
    
    aligned}
$$

公式显示如下:
cos ⁡ 2 x = cos ⁡ 2 x − sin ⁡ 2 x = 2 cos ⁡ 2 x − 1 \begin{aligned} \cos 2x &= \cos^2x - \sin^2x \\ &=2\cos^2x-1 \end{aligned} cos2x=cos2xsin2x=2cos2x1

三、LaTex输入矩阵的方法

$$
\begin{gathered}
\begin{matrix} 0 & 1 \\ 1 & 0 \end{matrix}
\quad
\begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}
\quad
\begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}
\quad
\begin{Bmatrix} 1 & 0 \\ 0 & -1 \end{Bmatrix}
\quad
\begin{vmatrix} a & b \\ c & d \end{vmatrix}
\quad
\begin{Vmatrix} i & 0 \\ 0 & -i \end{Vmatrix}
\end{gathered}
$$

对应显示如下:
0 1 1 0 ( 0 − i i 0 ) [ 0 − 1 1 0 ] { 1 0 0 − 1 } ∣ a b c d ∣ ∥ i 0 0 − i ∥ \begin{gathered} \begin{matrix} 0 & 1 \\ 1 & 0 \end{matrix} \quad \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix} \quad \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} \quad \begin{Bmatrix} 1 & 0 \\ 0 & -1 \end{Bmatrix} \quad \begin{vmatrix} a & b \\ c & d \end{vmatrix} \quad \begin{Vmatrix} i & 0 \\ 0 & -i \end{Vmatrix} \end{gathered} 0110(0ii0)[0110]{ 1001}acbdi00i

Guess you like

Origin blog.csdn.net/weixin_43943476/article/details/121560633