最近写Typora,需要写公式,记录简单的LaTeX公式排版,mathpix好用,但现在免费次数越来越少了,还是得记忆一下。
公式对齐
将公式写在$$ \begin{aligned}...\end{aligned} $$
中间,用&
对齐,\\
换行,
$$
\begin{aligned}
A & = 1 + 1 \\
& = 2
\end{aligned}
$$
A = 1 + 1 = 2 \begin{aligned} A & = 1 + 1 \\ & = 2 \end{aligned} A=1+1=2
$$
\begin{aligned}
A & =\frac{L_2-L_1}{L_3-L_2} \cdot \frac{m_3-m_2}{m_2-m_1} \\
& =\frac{L_2-L_1}{L_3-L_2} \cdot \frac{\frac{1}{t_3}-\frac{1}{t_2}}{\frac{1}{t_2}-\frac{1}{t_1}} \\
& =\frac{t_1}{t_3} \cdot \frac{L_2-L_1}{L_3-L_2} \cdot \frac{t_3-t_2}{t_2-t_1} \\
\end{aligned}
,
\qquad
\begin{aligned}
m_0 & =\frac{m_3-m_1 A}{1-A} \\
& =\frac{\frac{1}{t_3}-\frac{1}{t_1} A}{1-A} \\
& =\frac{t_1-t_3 A}{(1-A) t_1 t_3}
\end{aligned}
$$
A = L 2 − L 1 L 3 − L 2 ⋅ m 3 − m 2 m 2 − m 1 = L 2 − L 1 L 3 − L 2 ⋅ 1 t 3 − 1 t 2 1 t 2 − 1 t 1 = t 1 t 3 ⋅ L 2 − L 1 L 3 − L 2 ⋅ t 3 − t 2 t 2 − t 1 , m 0 = m 3 − m 1 A 1 − A = 1 t 3 − 1 t 1 A 1 − A = t 1 − t 3 A ( 1 − A ) t 1 t 3 \begin{aligned} A & =\frac{L_2-L_1}{L_3-L_2} \cdot \frac{m_3-m_2}{m_2-m_1} \\ & =\frac{L_2-L_1}{L_3-L_2} \cdot \frac{\frac{1}{t_3}-\frac{1}{t_2}}{\frac{1}{t_2}-\frac{1}{t_1}} \\ & =\frac{t_1}{t_3} \cdot \frac{L_2-L_1}{L_3-L_2} \cdot \frac{t_3-t_2}{t_2-t_1} \\ \end{aligned} , \qquad \begin{aligned} m_0 & =\frac{m_3-m_1 A}{1-A} \\ & =\frac{\frac{1}{t_3}-\frac{1}{t_1} A}{1-A} \\ & =\frac{t_1-t_3 A}{(1-A) t_1 t_3} \end{aligned} A=L3−L2L2−L1⋅m2−m1m3−m2=L3−L2L2−L1⋅t21−t11t31−t21=t3t1⋅L3−L2L2−L1⋅t2−t1t3−t2,m0=1−Am3−m1A=1−At31−t11A=(1−A)t1t3t1−t3A
分段函数 大括号
\begin{cases}...\end{cases}
表示大括号,在括号内用&
对齐,\\
换行
$$
y= \begin{cases}\exp (-a *(0.2-x)) \cdot 100 &,\quad x < 0.2 \\
100 &,\quad 0.2 <= x<=1 \\
\exp (-a *(x-1)) \cdot 100 &,\quad x > 1\end{cases} \\
$$
y = { exp ( − a ∗ ( 0.2 − x ) ) ⋅ 100 , x < 0.2 100 , 0.2 < = x < = 1 exp ( − a ∗ ( x − 1 ) ) ⋅ 100 , x > 1 y= \begin{cases}\exp (-a *(0.2-x)) \cdot 100 &,\quad x < 0.2 \\ 100 &,\quad 0.2 <= x<=1 \\ \exp (-a *(x-1)) \cdot 100 &,\quad x > 1\end{cases} \\ y=⎩ ⎨ ⎧exp(−a∗(0.2−x))⋅100100exp(−a∗(x−1))⋅100,x<0.2,0.2<=x<=1,x>1