- 行内公式(inline formula)和块级公式(displayed formula)
行内公式,使用 $…$包裹(enclose),块级公式,使用$$…$$。
键入$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$
显示,
x=−b±b2−4ac√2a
x
=
−
b
±
b
2
−
4
a
c
2
a
键入$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
显示,
- 希腊字母(Greek letters)
\alpha, \beta, ... \omega
:
α, β, …, ω
α
,
β
,
…
,
ω
\Gamma, \Delta, ... \Omega
:
Γ, Δ, …, Ω
Γ
,
Δ
,
…
,
Ω
- 上标(superscripts)和下标(subscripts)
上标^
,下标_
,例如:
x_i^2
:
x2i
x
i
2
\log_x 2
logi2
log
i
2
- 分组(groups)
上标和下标作用于分组,使用花括号(curly braces)。
x^y^z
:x^y^z
x^y^z
(错误,非预期),10^10
:
1010
10
1
0
(错误,非预期)。
x^{y^z}
:
xyz
x
y
z
,{x^y}^z
:
xyz
x
y
z
,注意后面的z
比较低。
- 括号(parentheses)
圆括号(parentheses)(2+3)
:
(2+3)
(
2
+
3
)
,方括号(brackets)[2+3]
:
[2+3]
[
2
+
3
]
,花括号(curly braces){2+3}
:
{2+3}
{
2
+
3
}
,尖括号(angle brackets)\langle x \rangle
:
⟨x⟩
⟨
x
⟩
。
绝对值(垂直线,vertical)\vert x \vert
:
|x|
|
x
|
,双垂直线\Vert x \Vert
:
∥x∥
‖
x
‖
,\lceil x \rceil
:
⌈x⌉
⌈
x
⌉
,\lfloor x \rfloor
:
⌊x⌋
⌊
x
⌋
。
可以使用隐藏括号.
,\lelft. a^\frac{1}{2}/b\right}
:
x=a12/b}
x
=
a
1
2
/
b
}
使用\middle
使除号更合适, = \left. a^\frac{1}{2}\middle/b \right.
:
x=a12/b
x
=
a
1
2
/
b
括号默认不会随着formula的内容缩放,(\frac{\sqrt x}{y^3})
:
(x√y3)
(
x
y
3
)
,使用\left(...\right)
可以让括号随内容缩放,\left(\frac{\sqrt x}{y^3}\right)
:
(x√y3)
(
x
y
3
)
。
或者使用\bigl \Bigl \biggl \Biggl ...
,括号不要求必须同类型、成对出现:\lfloor x \rceil
:
⌊x⌉
⌊
x
⌉
。
\Biggl( \biggl( \Bigl( \bigl( (x) \bigr) \Bigr) \biggr) \Biggr)
:
(((((x)))))
(
(
(
(
(
x
)
)
)
)
)
\Bigl{ \bigl\vert (\left(\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\right)) \bigr} \Bigr]
:
{∣∣((−b±b2−4ac√2a))}]
{
|
(
(
−
b
±
b
2
−
4
a
c
2
a
)
)
}
]
- 聚合(sums)和积分(integrals)
\sum_{i=0}^\infty i^2
:
∑∞i=0i2
∑
i
=
0
∞
i
2
\prod
:
∏
∏
,\int
:
∫
∫
,\iint
:
∬
∬
,\iiint
:
∭
∭
,\bigcup
:
⋃
⋃
,\bigcap
:
⋂
⋂
- 分数(fractions)
\frac
作用于接下来的两个分组(next two groups),\frac {a+1}{b+1}
:
a+1b+1
a
+
1
b
+
1
。
分子(numerator)和分母(denominator)复杂时,{a+1}\over{b+1}
:
a+1b+1
a
+
1
b
+
1
。
- 字体(fonts)
blackboard bold 字体,\mathbb {优快云}
:
CSDN
C
S
D
N
boldface 字体,\mathbf {优快云}
:
CSDN
C
S
D
N
typewriter 字体,\mathtt {优快云}
:
CSDN
C
S
D
N
roman 字体,\mathrm {优快云}
:
CSDN
C
S
D
N
sans-serif 字体,\mathsf {优快云}
:
CSDN
C
S
D
N
calligraphic 字体,\mathcal {优快云}
:
CSDN
C
S
D
N
script 字体,\mathscr {优快云}
:
CSDN
C
S
D
N
Fraktur 字体,\mathfrak {优快云}
:
CSDN
C
S
D
N
- 开方(radical signs)
\sqrt {x^3}
:
x3−−√
x
3
,\sqrt[4]{\frac xy}
:
xy−−√4
x
y
4
。
\left(\frac xy \right)^{1/4}
:
(xy)1/4
(
x
y
)
1
/
4
- 特殊函数(special functions)
\lim \sin \max \ln
\lim_{x\to 0}
:
limx→0
lim
x
→
0
注意区别:\sin x
:
sinx
sin
x
(正确),sinx
:
sinx
s
i
n
x
- 特殊符号和注记(special symbols and notions)
转义字符(escape character)\
,反斜线\backslash
:
∖
∖
,换行使用\\
\lt \gt \le \leq \leqq \ge \geq \geqq \neq
:
<
<
,
>
>
,
≤
≤
,
≤
≤
,
≦
≦
,
≥
≥
,
≥
≥
,
≧
≧
,
≠
≠
加\not会添加斜线,\not \gt, \not \leqq
:
≯
≯
,
≦̸
≦̸
\times \div \pm \mp \cdot
:
×
×
,
÷
÷
,
±
±
,
∓
∓
,
x⋅y
x
⋅
y
\cup \cap \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing \setminus
:
∪
∪
,
∩
∩
,
⊂
⊂
,
⊆
⊆
,
⊊
⊊
,
⊃
⊃
,
∈
∈
,
∉
∉
,
∅
∅
,
∅
∅
,
∖
∖
\to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto
:
→
→
,
→
→
,
←
←
,
⇒
⇒
,
⇐
⇐
,
↦
↦
\land \lor \lnot \forall \exists \top \bot \vdash \vDash
:
∧
∧
,
∨
∨
,
¬
¬
,
∀
∀
,
∃
∃
,
⊤
⊤
,
⊥
⊥
,
⊢
⊢
,
⊨
⊨
\star \ast \oplus \circ \bullet
:
⋆
⋆
,
∗
∗
,
⊕
⊕
,
∘
∘
,
∙
∙
\approx \sim \simeq \cong \equiv \prec \lhd
:
≈
≈
,
∼
∼
,
≃
≃
,
≅
≅
,
≡
≡
,
≺
≺
,
⊲
⊲
\infty
:
∞
∞
1, 2, \ldots,n
:
1,2,…,n
1
,
2
,
…
,
n
。1 + 2 + \cdots + n
:
1+2+⋯+n
1
+
2
+
⋯
+
n
- 空格(spaces)
短空格a\ b
:
a b
a
b
,宽空格a\quad b
:
ab
a
b
,长空格a\qquad b
:
ab
a
b
- 发音符号(accents and diacritical marks)
\hat \widehat \bar \overline \vec \overrightarrow \overleftrightarrow \dot \ddot
:
x^
x
^
,
xyˆ
x
y
^
,
x¯
x
¯
,
xy¯¯¯¯¯
x
y
¯
,
x⃗
x
→
,
xy−→
x
y
→
,
xy←→
x
y
↔
,
x˙
x
˙
,
x¨
x
¨
参考:
https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference