- 行内公式(inline formula)和块级公式(displayed formula)
行内公式,使用 $…$包裹(enclose),块级公式,使用$$…$$。
键入$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$
显示,
键入$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
显示,
- 希腊字母(Greek letters)
\alpha, \beta, ... \omega
:
\Gamma, \Delta, ... \Omega
:
- 上标(superscripts)和下标(subscripts)
上标^
,下标_
,例如:
x_i^2
:
\log_x 2
- 分组(groups)
上标和下标作用于分组,使用花括号(curly braces)。
x^y^z
:
(错误,非预期),10^10
:
(错误,非预期)。
x^{y^z}
:
,{x^y}^z
:
,注意后面的z
比较低。
- 括号(parentheses)
圆括号(parentheses)(2+3)
:
,方括号(brackets)[2+3]
:
,花括号(curly braces){2+3}
:
,尖括号(angle brackets)\langle x \rangle
:
。
绝对值(垂直线,vertical)\vert x \vert
:
,双垂直线\Vert x \Vert
:
,\lceil x \rceil
:
,\lfloor x \rfloor
:
。
可以使用隐藏括号.
,\lelft. a^\frac{1}{2}/b\right}
:
使用\middle
使除号更合适, = \left. a^\frac{1}{2}\middle/b \right.
:
括号默认不会随着formula的内容缩放,(\frac{\sqrt x}{y^3})
:
,使用\left(...\right)
可以让括号随内容缩放,\left(\frac{\sqrt x}{y^3}\right)
:
。
或者使用\bigl \Bigl \biggl \Biggl ...
,括号不要求必须同类型、成对出现:\lfloor x \rceil
:
。
\Biggl( \biggl( \Bigl( \bigl( (x) \bigr) \Bigr) \biggr) \Biggr)
:
\Bigl{ \bigl\vert (\left(\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\right)) \bigr} \Bigr]
:
- 聚合(sums)和积分(integrals)
\sum_{i=0}^\infty i^2
:
\prod
:
,\int
:
,\iint
:
,\iiint
:
,\bigcup
:
,\bigcap
:
- 分数(fractions)
\frac
作用于接下来的两个分组(next two groups),\frac {a+1}{b+1}
:
。
分子(numerator)和分母(denominator)复杂时,{a+1}\over{b+1}
:
。
- 字体(fonts)
blackboard bold 字体,\mathbb {CSDN}
:
boldface 字体,\mathbf {CSDN}
:
typewriter 字体,\mathtt {CSDN}
:
roman 字体,\mathrm {CSDN}
:
sans-serif 字体,\mathsf {CSDN}
:
calligraphic 字体,\mathcal {CSDN}
:
script 字体,\mathscr {CSDN}
:
Fraktur 字体,\mathfrak {CSDN}
:
- 开方(radical signs)
\sqrt {x^3}
:
,\sqrt[4]{\frac xy}
:
。
\left(\frac xy \right)^{1/4}
:
- 特殊函数(special functions)
\lim \sin \max \ln
\lim_{x\to 0}
:
注意区别:\sin x
:
(正确),sinx
:
- 特殊符号和注记(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
:
,
,
,
,
\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 + \cdots + n
:
- 空格(spaces)
短空格a\ b
:
,宽空格a\quad b
:
,长空格a\qquad b
:
- 发音符号(accents and diacritical marks)
\hat \widehat \bar \overline \vec \overrightarrow \overleftrightarrow \dot \ddot
:
,
,
,
,
,
,
,
,
参考:
https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference