markdown 公式篇
代码结构
$$
...公式\\ 换行
...公式\\ 换行
$$
对齐方式
- 以\begin{align}和\end{aligned}括起来,
- 在需要对齐的符号(如等号)前加&来标记,
- 用\来换行。
- 单公式以等号对齐
效果:
16 = ( 5 + 3 ) ∗ 8 = 8 ∗ 8 = 64 \begin{aligned} 16 &= ( 5+3 )*8 \\ &=8*8\\ &=64 \end{aligned} 16=(5+3)∗8=8∗8=64
代码:
\begin{aligned}
KPI&=(N+S)W \\
&=NW+SW
\end{aligned}
- 多公式以首个字符对齐
效果:
A B V = B B V = c c N = B \begin{aligned} &ABV=B \\ &BV=cc \\ &N=B \end{aligned} ABV=BBV=ccN=B
代码:
\begin{aligned}
&KPI=(N+S)W \\
&PI=N+S \\
&I=W
\end{aligned}
双层公式及注释
f
(
n
)
=
{
n
/
2
,
if
n
is even
3
n
+
1
,
if
n
is odd
f(n)= \begin{cases} n/2, & \text {if $n$ is even} \\ 3n+1, & \text{if $n$ is odd} \end{cases}
f(n)={n/2,3n+1,if n is evenif n is odd
代码:
f(n)= \begin{cases}
n/2, & \text {if
n
n
n is even} \
3n+1, & \text{if
n
n
n is odd} \end
{cases}
语法整理
展示 | 代码 | 说明 |
---|---|---|
∈ \in ∈ | \in | 属于 |
≠ \neq = | \nep | 不等于 |
̸ \not | \not | |
≡ \equiv ≡ | \equiv | 取模 |
⨁ \bigoplus ⨁ | \bigoplus | 异或 |
—未完待续----