本手册全新编排版正在施工,感兴趣的戳这里!
参考维基百科的数学公式教程
参考Cmd Markdown 公式指导手册
本文为 MathJax 在 Markdown 环境下的语法指引。
\(\LaTeX\) 的数学公式有两种:行中公式和独立公式(行间公式)。行中公式放在文中与其它文字混编,独立公式单独成行。
行中公式可以用如下方法表示:
独立公式可以用如下方法表示:
\({\displaystyle {\dot {a}},{\ddot {a}},{\acute {a}},{\grave {a}}}\)
\({\displaystyle {\check {a}},{\breve {a}},{ ilde {a}},{\bar {a}}}\)
\({\displaystyle {\hat {a}},{\widehat {a}},{\vec {a}}}\)
指数
\({\displaystyle \exp _{a}b=a^{b},\exp b=e^{b},10^{m}}\)
对数
\({\displaystyle \ln c,\lg d=\log e,\log _{10}f}\)
三角函数
\({\displaystyle \sin a,\cos b, an c,\cot d,\sec e,\csc f}\)
\({\displaystyle \arcsin a,\arccos b,\arctan c}\)
\({\displaystyle \operatorname {arccot} d,\operatorname {arcsec} e,\operatorname {arccsc} f}\)
\({\displaystyle \sinh a,\cosh b, anh c,\coth d}\)
\({\displaystyle \operatorname {sh} k,\operatorname {ch} l,\operatorname {th} m,\operatorname {coth} n}\)
\({\displaystyle \operatorname {argsh} o,\operatorname {argch} p,\operatorname {argth} q}\)
符号函数,绝对值
\({\displaystyle \operatorname {sgn} r,\left\vert s\right\vert }\)
最大值,最小值
\({\displaystyle \min(x,y),\max(x,y)}\)
\({\displaystyle \min x,\max y,\inf s,\sup t}\)
\({\displaystyle \lim u,\liminf v,\limsup w}\)
\({\displaystyle \lim_{x o \infty} \frac{1}{n(n+1)}}\)
\({\displaystyle \dim p,\deg q,\det m,\ker \phi}\)
\({\displaystyle \Pr j,\hom l,\lVert z\rVert ,\arg z}\)
\({\displaystyle dt,\mathrm {d} t,\partial t, abla \psi }\)
\({\displaystyle dy/dx,\mathrm {d} y/\mathrm {d} x,{\frac {dy}{dx}},{\frac {\mathrm {d} y}{\mathrm {d} x}},{\frac {\partial ^{2}}{\partial x_{1}\partial x_{2}}}y}\)
\({\displaystyle \prime ,\backprime ,f^{\prime},f',f'',f^{(3)}\!,{\dot {y}},{\ddot {y}}}\)
\({\displaystyle \infty ,\aleph ,\complement ,\backepsilon ,\eth ,\Finv ,\hbar}\)
\({\displaystyle \Im ,\imath ,\jmath ,\Bbbk ,\ell ,\mho ,\wp ,\Re ,\circledS }\)
\({\displaystyle s_{k}\equiv 0{\pmod {m}}}\)
\({\displaystyle a \bmod b}\)
\({\displaystyle \gcd(m,n),\operatorname {lcm} (m,n)}\)
\({\displaystyle \mid , mid ,\shortmid , shortmid}\)
\({\displaystyle \surd ,{\sqrt {2}},{\sqrt[{n}]{}},{\sqrt[{3}]{\frac {x^{3}+y^{3}}{2}}}}\)
\({\displaystyle +,-,\pm ,\mp ,\dotplus}\)
\({\displaystyle imes ,\div ,\divideontimes ,/,\backslash}\)
\({\displaystyle \cdot ,*\ast ,\star ,\circ ,\bullet}\)
\({\displaystyle \boxplus ,\boxminus ,\boxtimes ,\boxdot}\)
\({\displaystyle \oplus ,\ominus ,\otimes ,\oslash ,\odot}\)
\({\displaystyle \circleddash ,\circledcirc ,\circledast}\)
\({\displaystyle \bigoplus ,\bigotimes ,\bigodot}\)
\({\displaystyle \{\},\emptyset \emptyset \emptyset ,\varnothing }\)
\({\displaystyle \in , otin ot \in , i , ot i}\)
\({\displaystyle \cap ,\Cap ,\sqcap ,\bigcap}\)
\({\displaystyle \cup ,\Cup ,\sqcup ,\bigcup ,\bigsqcup ,? ,\biguplus}\)
\({\displaystyle \setminus ,\smallsetminus , imes}\)
\({\displaystyle \subset ,\Subset ,\sqsubset}\)
\({\displaystyle \supset ,\Supset ,\sqsupset}\)
\({\displaystyle \subseteq , subseteq ,\subsetneq ,\varsubsetneq ,\sqsubseteq}\)
\({\displaystyle \supseteq , supseteq ,\supsetneq ,\varsupsetneq ,\sqsupseteq}\)
\({\displaystyle \subseteqq , subseteqq ,\subsetneqq ,\varsubsetneqq}\)
\({\displaystyle \supseteqq , supseteqq ,\supsetneqq ,\varsupsetneqq}\)
\({\displaystyle=, eq , eq ,\equiv , ot \equiv}\)
\({\displaystyle \doteq ,\doteqdot ,{\overset {緻set {\mathrm {def} }{}}{=}},:=}\)
\({\displaystyle \sim , sim ,\backsim , hicksim ,\simeq ,\backsimeq ,\eqsim ,\cong , cong}\)
\({\displaystyle \approx , hickapprox ,\approxeq ,\asymp ,\propto ,\varpropto}\)
\({\displaystyle <, less ,\ll , ot \ll ,\lll , ot \lll ,\lessdot}\)
\({\displaystyle>, gtr ,\gg , ot \gg ,\ggg , ot \ggg ,\gtrdot }\)
\({\displaystyle \leq ,\leq ,\lneq ,\leqq , leq , leqq ,\lneqq ,\lvertneqq}\)
\({\displaystyle \geq ,\geq ,\gneq ,\geqq , geq , geqq ,\gneqq ,\gvertneqq}\)
\({\displaystyle \lessgtr ,\lesseqgtr ,\lesseqqgtr ,\gtrless ,\gtreqless ,\gtreqqless}\)
\({\displaystyle \leqslant , leqslant ,\eqslantless}\)
\({\displaystyle \geqslant , geqslant ,\eqslantgtr}\)
\({\displaystyle \lesssim ,\lnsim ,\lessapprox ,\lnapprox}\)
\({\displaystyle \gtrsim ,\gnsim ,\gtrapprox ,\gnapprox}\)
\({\displaystyle \prec , prec ,\preceq , preceq ,\precneqq}\)
\({\displaystyle \succ , succ ,\succeq , succeq ,\succneqq}\)
\({\displaystyle \preccurlyeq ,\curlyeqprec}\)
\({\displaystyle \succcurlyeq ,\curlyeqsucc}\)
\({\displaystyle \precsim ,\precnsim ,\precapprox ,\precnapprox}\)
\({\displaystyle \succsim ,\succnsim ,\succapprox ,\succnapprox}\)
\({\displaystyle \parallel , parallel ,\shortparallel , shortparallel}\)
\({\displaystyle \perp ,\angle ,\sphericalangle ,\measuredangle ,45^{\circ}}\)
\({\displaystyle \Box ,\blacksquare ,\diamond ,\Diamond \lozenge ,\blacklozenge ,\bigstar}\)
\({\displaystyle \bigcirc , riangle ,\bigtriangleup ,\bigtriangledown}\)
\({\displaystyle \vartriangle , riangledown}\)
\({\displaystyle \blacktriangle ,\blacktriangledown ,\blacktriangleleft ,\blacktriangleright}\)
\({\displaystyle \forall ,\exists , exists}\)
\({\displaystyle herefore ,\because ,\And}\)
\({\displaystyle \lor ,\lor ,\vee ,\curlyvee ,\bigvee}\)
\({\displaystyle \land ,\land ,\wedge ,\curlywedge ,\bigwedge}\)
\({\displaystyle {\bar {q}},{\bar {abc}},{\overline {q}},{\overline {abc}},}\)
\({\displaystyle \lnot eg , ot \operatorname {R} ,\bot , op }\)
\({\displaystyle \vdash ,\dashv ,\vDash ,\Vdash ,\models}\)
\({\displaystyle \Vvdash , vdash , Vdash , vDash , VDash}\)
\({\displaystyle 嶛ner ?ner \llcorner \lrcorner}\)
\({\displaystyle \Rrightarrow ,\Lleftarrow}\)
\({\displaystyle \Rightarrow , Rightarrow ,\Longrightarrow ,\implies}\)
\({\displaystyle \Leftarrow , Leftarrow ,\Longleftarrow}\)
\({\displaystyle \Leftrightarrow , Leftrightarrow ,\Longleftrightarrow \iff}\)
\({\displaystyle \Uparrow ,\Downarrow ,\Updownarrow}\)
\({\displaystyle \rightarrow o , rightarrow ,\longrightarrow}\)
\({\displaystyle \leftarrow \gets , leftarrow ,\longleftarrow}\)
\({\displaystyle \leftrightarrow , leftrightarrow ,\longleftrightarrow}\)
\({\displaystyle 鯋ow ,\downarrow ,麠narrow}\)
\({\displaystyle earrow ,\swarrow , warrow ,\searrow}\)
\({\displaystyle \mapsto ,\longmapsto}\)
\({\displaystyle \rightharpoonup ,\rightharpoondown ,\leftharpoonup ,\leftharpoondown ,?poonleft ,?poonright ,\downharpoonleft ,\downharpoonright ,\rightleftharpoons ,\leftrightharpoons}\)
\({\displaystyle \curvearrowleft ,\circlearrowleft ,\Lsh ,?rrows ,\rightrightarrows ,\rightleftarrows ,\rightarrowtail ,\looparrowright}\)
\({\displaystyle \curvearrowright ,\circlearrowright ,\Rsh ,\downdownarrows ,\leftleftarrows ,\leftrightarrows ,\leftarrowtail ,\looparrowleft}\)
\({\displaystyle \hookrightarrow ,\hookleftarrow ,\multimap ,\leftrightsquigarrow ,\rightsquigarrow , woheadrightarrow , woheadleftarrow}\)
省略号:数学公式中常见的省略号有两种, 表示与文本底线对齐的省略号, 表示与文本中线对齐的省略号。
\({\displaystyle \amalg \%\dagger \ddagger \ldots \cdots}\)
\({\displaystyle \smile \frown \wr riangleleft riangleright}\)
\({\displaystyle \diamondsuit ,\heartsuit ,\clubsuit ,\spadesuit ,\Game ,\flat , atural ,\sharp}\)
\({\displaystyle \diagup ,\diagdown ,\centerdot ,\ltimes ,\rtimes ,\leftthreetimes ,\rightthreetimes}\)
\({\displaystyle \eqcirc ,\circeq , riangleq ,\bumpeq ,\Bumpeq ,\doteqdot ,\risingdotseq ,\fallingdotseq}\)
\({\displaystyle \intercal ,\barwedge ,\veebar ,\doublebarwedge ,\between ,\pitchfork}\)
\({\displaystyle \vartriangleleft , triangleleft ,\vartriangleright , triangleright}\)
\({\displaystyle rianglelefteq , trianglelefteq , rianglerighteq , trianglerighteq}\)
关于这些符号的更多语义,参阅 TeX Cookbook 的简述。
功能|语法|效果
表示上标, 表示下标。如果上下标的内容多于一个字符,需要用 将这些内容括成一个整体。上下标可以嵌套,也可以同时使用。
上标
\({\displaystyle a^{2}}\)
下标
\({\displaystyle a_{2}}\)
组合
\({\displaystyle a^{2+2}}\)
\({\displaystyle a_{i,j}}\)
结合上下标
\({\displaystyle x_{2}^{3}}\)
前置上下标
\({\displaystyle {}_{1}^{2}\!X_{3}^{4}}\)
导数(HTML)
\({\displaystyle x'}\)
导数(PNG)
\({\displaystyle x^{\prime}}\)
导数(错误)
\({\displaystyle x\prime}\)
导数点
\({\displaystyle {\dot {x}}}\)
\({\displaystyle {\ddot {y}}}\)
向量
(只有一个字母)
\({\displaystyle {\vec {c}}}\)
\({\displaystyle {\overleftarrow {ab}}}\)
\({\displaystyle {\overrightarrow {cd}}}\)
\({\displaystyle {\overleftrightarrow {ab}}}\)
\({\displaystyle {\widehat {efg}}}\)
上弧
(注: 正确应该用 \overarc,但在这里行不通。要用建议的语法作为解决办法。)(使用 \ overarc 时需要引入 {arcs} 包。)
\({\displaystyle {\overset {\frown}{AB}}}\)
上划线
\({\displaystyle {\overline {hij}}}\)
下划线
\({\displaystyle {緻line {klm}}}\)
上括号
\({\displaystyle \overbrace {1+2+\cdots +100} }\)
\({\displaystyle {\begin{matrix}5050\\\overbrace {1+2+\cdots +100} \end{matrix}}}\)
下括号
\({\displaystyle 緻brace {a+b+\cdots +z} }\)
\({\displaystyle {\begin{matrix}緻brace {a+b+\cdots +z} \\26\end{matrix}}}\)
求和(累加)
\({\displaystyle \sum _{k=1}^{N}k^{2}}\)
\({\displaystyle {\begin{matrix}\sum _{k=1}^{N}k^{2}\end{matrix}}}\)
求积(累乘)
\({\displaystyle \prod _{i=1}^{N}x_{i}}\)
\({\displaystyle {\begin{matrix}\prod _{i=1}^{N}x_{i}\end{matrix}}}\)
上积
\({\displaystyle \coprod _{i=1}^{N}x_{i}}\)
\({\displaystyle {\begin{matrix}\coprod _{i=1}^{N}x_{i}\end{matrix}}}\)
极限
\({\displaystyle \lim _{n o \infty}x_{n}}\)
\({\displaystyle {\begin{matrix}\lim _{n o \infty }x_{n}\end{matrix}}}\)
积分
\({\displaystyle \int _{-N}^{N}e^{x}\,{\rm d} x}\)
本例中 和 部分可省略,但建议加入,能使式子更美观。可以用等价替换。
(矩阵中积分符号变小)
\({\displaystyle {\begin{matrix}\int _{-N}^{N}e^{x}\,\mathrm {d} x\end{matrix}}}\)
双重积分
\({\displaystyle \iint _{D}^{W}\,\mathrm {d} x\,\mathrm {d} y}\)
三重积分
\({\displaystyle \iiint _{E}^{V}\,\mathrm {d} x\,\mathrm {d} y\,\mathrm {d} z}\)
闭合的曲线、曲面积分
\({\displaystyle \oint _{C}x^{3}\,\mathrm {d} x+4y^{2}\,\mathrm {d} y}\)
交集
\({\displaystyle \bigcap _{1}^{n}p}\)
并集
\({\displaystyle \bigcup _{1}^{k}p}\)
通常使用 命令产生一个分数,分数可嵌套。
便捷情况可直接输入 来快速生成一个 \(\frac ab\) 。
如果分式很复杂,亦可使用 命令,此时分数仅有一层。
功能|语法|效果
分数
\({\displaystyle {\frac {2}{4}}=0.5}\)
小型分数
\({\displaystyle { frac {2}{4}}=0.5}\)
连分式(大型嵌套分式)
\({\displaystyle {\cfrac {2}{c+{\cfrac {2}{d+{\cfrac {2}{4}}}}}}=a}\)
大型不嵌套分式
\({\displaystyle {\dfrac {2}{4}}=0.5\qquad {\dfrac {2}{c+{\dfrac {2}{d+{\dfrac {2}{4}}}}}}=a}\)
二项式系数
\({\displaystyle {\dbinom {n}{r}}={\binom {n}{n-r}}=\mathrm {C} _{n}^{r}=\mathrm {C} _{n}^{n-r}}\)
小型二项式系数
\({\displaystyle { binom {n}{r}}={ binom {n}{n-r}}=\mathrm {C} _{n}^{r}=\mathrm {C} _{n}^{n-r}}\)
大型二项式系数
\({\displaystyle {\binom {n}{r}}={\dbinom {n}{n-r}}=\mathrm {C} _{n}^{r}=\mathrm {C} _{n}^{n-r}}\)
在以e为底的指数函数、极限和积分中尽量不要使用 符号:它会使整段函数看起来很怪,而且可能产生歧义。也正是因此它在专业数学排版中几乎从不出现。
横着写这些分式,中间使用斜线间隔 (用斜线代替分数线)。
- 例子:
- 显示:
语法:
类型可以是:矩阵 、条件表达式 、多行对齐方程式 、数组 。
在公式内容中:在每一行中插入 来指定需要对齐的内容,在每行结尾处使用 换行。
在开头使用 ,在结尾使用 ,在中间插入矩阵元素,每个元素之间插入 ,并在每行结尾处使用 。
\({\displaystyle {\begin{matrix}x&y\\z&v\end{matrix}}}\)
在开头将 替换为 。
\({\displaystyle {\begin{vmatrix}x&y\\z&v\end{vmatrix}}}\)
\({\displaystyle {\begin{Vmatrix}x&y\\z&v\end{Vmatrix}}}\)
使用 \(\cdots\) , \(\ddots\) , \(\vdots\) 来输入省略符号。
\({\displaystyle {\begin{bmatrix}0&\cdots &0\\\vdots &\ddots &\vdots \\0&\cdots &0\end{bmatrix}}}\)
\({\displaystyle {\begin{Bmatrix}x&y\\z&v\end{Bmatrix}}}\)
\({\displaystyle {\begin{pmatrix}x&y\\z&v\end{pmatrix}}}\)
\({\displaystyle f(n)={\begin{cases}n/2,&{ ext{if }}n{ ext{ is even}}\\3n+1,&{ ext{if }}n{ ext{ is odd}}\end{cases}}}\)
人们经常想要一列整齐且居中的方程式序列。使用 。
\({\displaystyle {\begin{aligned}f(x)&=(m+n)^{2}\\&=m^{2}+2mn+n^{2}\\\end{aligned}}}\)
\({\displaystyle {\begin{aligned}3^{6n+3}+4^{6n+3}&\equiv (3^{3})^{2n+1}+(4^{3})^{2n+1}\\&\equiv 27^{2n+1}+64^{2n+1}\\&\equiv 27^{2n+1}+(-27)^{2n+1}\\&\equiv 27^{2n+1}-27^{2n+1}\\&\equiv 0{\pmod {91}}\\\end{aligned}}}\)
\({\displaystyle {\begin{alignedat}{3}f(x)&=(m-n)^{2}\\f(x)&=(-m+n)^{2}\\&=m^{2}-2mn+n^{2}\\\end{alignedat}}}\)
或
通常,一个格式化后的表格比单纯的文字或排版后的文字更具有可读性。数组和表格均以 开头,并在其后定义列数及每一列的文本对齐属性, 分别代表居中、左对齐及右对齐。若需要插入垂直分割线,在定义式中插入 ,若要插入水平分割线,在下一行输入前插入 。与矩阵相似,每行元素间均须要插入 ,每行元素以 结尾,最后以 结束数组。
- 例子:
- 显示:
- 例子:
- 显示:
\({\displaystyle {\begin{array}{lcl}z&=&a\\f(x,y,z)&=&x+y+z\end{array}}}\)
- 例子:
- 显示:
\({\displaystyle {\begin{array}{lcr}z&=&a\\f(x,y,z)&=&x+y+z\end{array}}}\)
- 例子:
- 显示:
多个数组/表格可 互相嵌套 并组成一组数组/一组表格。
使用嵌套前必须声明 符号。
- 例子:
- 显示:
- 例子:
- 显示:
其中 代表在一个三列矩阵中的第二和第三列之间插入分割线。
输入 和 来分别输入小写和大写希腊字母。
\({\displaystyle \mathrm {A} \mathrm {B} \Gamma \Delta \mathrm {E} \mathrm {Z} \mathrm {H} \Theta }\)
\({\displaystyle \mathrm {I} \mathrm {K} \Lambda \mathrm {M} \mathrm {N} \mathrm {O} \Xi \Pi }\)
\({\displaystyle \mathrm {P} \Sigma \mathrm {T} \Upsilon \Phi \mathrm {X} \Psi \Omega }\)
\({\displaystyle \alpha \beta \gamma \delta \epsilon \zeta \eta heta}\)
\({\displaystyle \iota \kappa \lambda \mu u \mathrm {o} \xi \pi }\)
\({\displaystyle \rho \sigma au ?on \phi \chi \psi \omega}\)
部分字母有变量专用形式,以 开头。
\({\displaystyle \varepsilon \digamma \varkappa \varpi}\)
\({\displaystyle \varrho \varsigma \vartheta \varphi}\)
\({\displaystyle \aleph \beth \gimel \daleth}\)
若要对公式的某一部分字符进行字体转换,可以用 命令,其中 部分可以参照下表选择合适的字体。一般情况下,公式默认为意大利体 \(italic\) 。
|输入|说明|显示|输入|说明|显示|
|:--:--:--:--:--:--:--
|\rm|罗马体|\(\rm{Sample}\)|\cal|花体|\(\cal{SAMPLE}\)|
|\it|意大利体|\(\it{Sample}\)|\Bbb|黑板粗体|\(\Bbb{SAMPLE}\)|
|\bf|粗体|\(\bf{Sample}\)|\mit|数学斜体|\(\mit{SAMPLE}\)|
|\sf|等线体|\(\sf{Sample}\)|\scr|手写体|\(\scr{SAMPLE}\)|
| t|打字机体|\( t{Sample}\)|\frak|旧德式字体|\(\frak{Sample}\)|
黑板报粗体
\({\displaystyle \mathbb {ABCDEFGHI} }\)
\({\displaystyle \mathbb {JKLMNOPQR} }\)
\({\displaystyle \mathbb {STUVWXYZ} }\)
粗体
\({\displaystyle \mathbf {ABCDEFGHI} }\)
\({\displaystyle \mathbf {JKLMNOPQR} }\)
\({\displaystyle \mathbf {STUVWXYZ} }\)
\({\displaystyle \mathbf {abcdefghijklm} }\)
\({\displaystyle \mathbf {nopqrstuvwxyz} }\)
\({\displaystyle \mathbf {} }\)
粗体希腊字母
\({\displaystyle {\boldsymbol {\mathrm {A} \mathrm {B} \Gamma \Delta \mathrm {E} \mathrm {Z} \mathrm {H} \Theta }}}\)
\({\displaystyle {\boldsymbol {\mathrm {I} \mathrm {K} \Lambda \mathrm {M} \mathrm {N} \Xi \Pi \mathrm {P} }}}\)
\({\displaystyle {\boldsymbol {\Sigma \mathrm {T} \Upsilon \Phi \mathrm {X} \Psi \Omega }}}\)
\({\displaystyle {\boldsymbol {\alpha \beta \gamma \delta \epsilon \zeta \eta heta}}}\)
\({\displaystyle {\boldsymbol {\iota \kappa \lambda \mu u \xi \pi \rho}}}\)
\({\displaystyle {\boldsymbol {\sigma au ?on \phi \chi \psi \omega}}}\)
\({\displaystyle {\boldsymbol {\varepsilon \digamma \varkappa \varpi}}}\)
\({\displaystyle {\boldsymbol {\varrho \varsigma \vartheta \varphi}}}\)
斜体(拉丁字母默认)
\({\displaystyle {\mathit {}}}\)
斜体希腊字母(小写字母默认)
\({\displaystyle {\mathit {\mathrm {A} \mathrm {B} \Gamma \Delta \mathrm {E} \mathrm {Z} \mathrm {H} \Theta }}}\)
\({\displaystyle {\mathit {\mathrm {I} \mathrm {K} \Lambda \mathrm {M} \mathrm {N} \Xi \Pi \mathrm {P} }}}\)
\({\displaystyle {\mathit {\Sigma \mathrm {T} \Upsilon \Phi \mathrm {X} \Psi \Omega }}}\)
罗马体
\({\displaystyle \mathrm {ABCDEFGHI} }\)
\({\displaystyle \mathrm {JKLMNOPQR} }\)
\({\displaystyle \mathrm {STUVWXYZ} }\)
\({\displaystyle \mathrm {abcdefghijklm} }\)
\({\displaystyle \mathrm {nopqrstuvwxyz} }\)
\({\displaystyle \mathrm {} }\)
无衬线体
\({\displaystyle {\mathsf {ABCDEFGHI}}}\)
\({\displaystyle {\mathsf {JKLMNOPQR}}}\)
\({\displaystyle {\mathsf {STUVWXYZ}}}\)
\({\displaystyle {\mathsf {abcdefghijklm}}}\)
\({\displaystyle {\mathsf {nopqrstuvwxyz}}}\)
\({\displaystyle {\mathsf {}}}\)
无衬线体希腊字母(仅大写)
\({\displaystyle {\mathsf {\mathrm {A} \mathrm {B} \Gamma \Delta \mathrm {E} \mathrm {Z} \mathrm {H} \Theta }}}\)
\({\displaystyle {\mathsf {\mathrm {I} \mathrm {K} \Lambda \mathrm {M} \mathrm {N} \Xi \Pi \mathrm {P} }}}\)
\({\displaystyle {\mathsf {\Sigma \mathrm {T} \Upsilon \Phi \mathrm {X} \Psi \Omega }}}\)
手写体 / 花体
\({\displaystyle {\mathcal {ABCDEFGHI}}}\)
\({\displaystyle {\mathcal {JKLMNOPQR}}}\)
\({\displaystyle {\mathcal {STUVWXYZ}}}\)
Fraktur 体
\({\displaystyle {\mathfrak {ABCDEFGHI}}}\)
\({\displaystyle {\mathfrak {JKLMNOPQR}}}\)
\({\displaystyle {\mathfrak {STUVWXYZ}}}\)
\({\displaystyle {\mathfrak {abcdefghijklm}}}\)
\({\displaystyle {\mathfrak {nopqrstuvwxyz}}}\)
\({\displaystyle {\mathfrak {}}}\)
小型手写体
\({\displaystyle {\scriptstyle { ext{abcdefghijklm}}}}\)
特征|语法|渲染效果
斜体字符(忽略空格)
\({\displaystyle xyz}\)
非斜体字符
\({\displaystyle { ext{x y z}}}\)
混合斜体(差)
\({\displaystyle { ext{if}}n{ ext{is even}}}\)
混合斜体(好)
\({\displaystyle { ext{if }}n{ ext{ is even}}}\)
混合斜体(替代品: 或者 强制空格)
\({\displaystyle { ext{if}}~n\ { ext{is even}}}\)
使用 来添加注释文本(注释文本不会被识别为公式,不用斜体显示)。中仍可以使用 插入其它公式。
- 例子:
- 显示:
、 和 表示符号本身,使用 来表示 。
功能|语法|显示
短括号
\({\displaystyle ({\frac {1}{2}})}\)
长括号
\({\displaystyle \left({\frac {1}{2}}\right)}\)
使用 和 来创建自动匹配高度的 (圆括号),[方括号] 和 {花括号} 。
功能|语法|显示
圆括号,小括号
\({\displaystyle \left({\frac {a}{b}}\right)}\)
方括号,中括号
\({\displaystyle \left[{\frac {a}{b}}\right]}\)
花括号,大括号
\({\displaystyle \left\{{\frac {a}{b}}\right\}}\)
角括号
\({\displaystyle \left\langle {\frac {a}{b}}\right\rangle }\)
单竖线,绝对值
\({\displaystyle \left| \frac{a}{b} \right|}\)
双竖线,范
\({\displaystyle \left\|{\frac {a}{b}}\right\|}\)
取整函数
\({\displaystyle \left\lfloor {\frac {a}{b}}\right\rfloor }\)
取顶函数
\({\displaystyle \left\lceil {\frac {c}{d}}\right\rceil }\)
斜线与反斜线
\({\displaystyle \left/{\frac {a}{b}}\right\backslash }\)
上下箭头
\({\displaystyle \left鯋ow {\frac {a}{b}}\right\downarrow }\)
\({\displaystyle \left\Uparrow {\frac {a}{b}}\right\Downarrow }\)
\({\displaystyle \left麠narrow {\frac {a}{b}}\right\Updownarrow }\)
混合括号
\({\displaystyle \left[0,1\right)}\)
\(\left \langle \psi \right |\)
如果括号只有一边,要用 或 匹配另一边。
单左括号
\({\displaystyle \left\{{\frac {a}{b}}\right.}\)
单右括号
\({\displaystyle \left.{\frac {a}{b}}\right\}}\)
备注:
-
可以使用 控制括号的大小,比如代码
显示︰
\[\Bigg ( \bigg [ \Big \{ \big \langle \left | \| \frac{a}{b} \| \right | \big \rangle \Big \} \bigg ] \Bigg ) \]
注意 TeX 能够自动处理大多数的空格,但是您有时候需要自己来控制。
功能|语法|显示|宽度
\({\displaystyle \alpha \qquad \beta}\)
\({\displaystyle mm}\)
\({\displaystyle \alpha \quad \beta}\)
\({\displaystyle m}\)
\({\displaystyle \alpha \ \beta}\)
\({\displaystyle {\frac{m}{3}}}\)
\({\displaystyle \alpha \;\beta}\)
\({\displaystyle {\frac {2m}{7}}}\)
\({\displaystyle \alpha \,\beta}\)
\({\displaystyle {\frac {m}{6}}}\)
\({\displaystyle \alpha \beta }\)
\({\displaystyle 0}\)
\({\displaystyle \alpha \!\beta}\)
\({\displaystyle -{\frac {m}{6}}}\)
使用 来更改特定的文字颜色。
更改文字颜色 需要浏览器支持 ,如果浏览器不知道你所需的颜色,那么文字将被渲染为黑色。
对于较旧的浏览器(HTML4与CSS2),以下颜色是被支持的:
输入 | 显示 | 输入 | 显示 |
---|---|---|---|
black | \(\color{black}{text}\) | grey | \(\color{grey}{text}\) |
silver | \(\color{silver}{text}\) | white | \(\color{white}{text}\) |
maroon | \(\color{maroon}{text}\) | red | \(\color{red}{text}\) |
yellow | \(\color{yellow}{text}\) | lime | \(\color{lime}{text}\) |
olive | \(\color{olive}{text}\) | green | \(\color{green}{text}\) |
teal | \(\color{teal}{text}\) | auqa | \(\color{auqa}{text}\) |
blue | \(\color{blue}{text}\) | navy | \(\color{navy}{text}\) |
purple | \(\color{purple}{text}\) | fuchsia | \(\color{fuchsia}{text}\) |
对于较新的浏览器(HTML5与CSS3),额外的124种颜色将被支持:
输入 来自定义更多的颜色,其中 的 可输入 和 来表示红色、绿色和蓝色的纯度(饱和度)。
- 例子:
- 显示:
- 例子:
- 显示:
语法:
作者实测:在部分浏览器中,上面的语法可能是错误的(只将表达式的第一个字符着色),的语法才是正确的。例如:
显示\({\color{Red}abc}\)
显示\(\color{Red}{abc}\)
支持色调表:
\({\displaystyle \color {Apricot}{ ext{Apricot}}}\)
\({\displaystyle \color {Aquamarine}{ ext{Aquamarine}}}\)
\({\displaystyle \color {Bittersweet}{ ext{Bittersweet}}}\)
\({\displaystyle \color {Black}{ ext{Black}}}\)
\({\displaystyle \color {Blue}{ ext{Blue}}}\)
\({\displaystyle \color {BlueGreen}{ ext{BlueGreen}}}\)
\({\displaystyle \color {BlueViolet}{ ext{BlueViolet}}}\)
\({\displaystyle \color {BrickRed}{ ext{BrickRed}}}\)
\({\displaystyle \color {Brown}{ ext{Brown}}}\)
\({\displaystyle \color {BurntOrange}{ ext{BurntOrange}}}\)
\({\displaystyle \color {CadetBlue}{ ext{CadetBlue}}}\)
\({\displaystyle \color {CarnationPink}{ ext{CarnationPink}}}\)
\({\displaystyle \color {Cerulean}{ ext{Cerulean}}}\)
\({\displaystyle \color {CornflowerBlue}{ ext{CornflowerBlue}}}\)
\({\displaystyle \color {Cyan}{ ext{Cyan}}}\)
\({\displaystyle \color {Dandelion}{ ext{Dandelion}}}\)
\({\displaystyle \color {DarkOrchid}{ ext{DarkOrchid}}}\)
\({\displaystyle \color {Emerald}{ ext{Emerald}}}\)
\({\displaystyle \color {ForestGreen}{ ext{ForestGreen}}}\)
\({\displaystyle \color {Fuchsia}{ ext{Fuchsia}}}\)
\({\displaystyle \color {Goldenrod}{ ext{Goldenrod}}}\)
\({\displaystyle \color {Gray}{ ext{Gray}}}\)
\({\displaystyle \color {Green}{ ext{Green}}}\)
\({\displaystyle \color {GreenYellow}{ ext{GreenYellow}}}\)
\({\displaystyle \color {JungleGreen}{ ext{JungleGreen}}}\)
\({\displaystyle \color {Lavender}{ ext{Lavender}}}\)
\({\displaystyle \color {LimeGreen}{ ext{LimeGreen}}}\)
\({\displaystyle \color {Magenta}{ ext{Magenta}}}\)
\({\displaystyle \color {Mahogany}{ ext{Mahogany}}}\)
\({\displaystyle \color {Maroon}{ ext{Maroon}}}\)
\({\displaystyle \color {Melon}{ ext{Melon}}}\)
\({\displaystyle \color {MidnightBlue}{ ext{MidnightBlue}}}\)
\({\displaystyle \color {Mulberry}{ ext{Mulberry}}}\)
\({\displaystyle \color {NavyBlue}{ ext{NavyBlue}}}\)
\({\displaystyle \color {OliveGreen}{ ext{OliveGreen}}}\)
\({\displaystyle \color {Orange}{ ext{Orange}}}\)
\({\displaystyle \color {OrangeRed}{ ext{OrangeRed}}}\)
\({\displaystyle \color {Orchid}{ ext{Orchid}}}\)
\({\displaystyle \color {Peach}{ ext{Peach}}}\)
\({\displaystyle \color {Periwinkle}{ ext{Periwinkle}}}\)
\({\displaystyle \color {PineGreen}{ ext{PineGreen}}}\)
\({\displaystyle \color {Plum}{ ext{Plum}}}\)
\({\displaystyle \color {ProcessBlue}{ ext{ProcessBlue}}}\)
\({\displaystyle \color {Purple}{ ext{Purple}}}\)
\({\displaystyle \color {RawSienna}{ ext{RawSienna}}}\)
\({\displaystyle \color {Red}{ ext{Red}}}\)
\({\displaystyle \color {RedOrange}{ ext{RedOrange}}}\)
\({\displaystyle \color {RedViolet}{ ext{RedViolet}}}\)
\({\displaystyle \color {Rhodamine}{ ext{Rhodamine}}}\)
\({\displaystyle \color {RoyalBlue}{ ext{RoyalBlue}}}\)
\({\displaystyle \color {RoyalPurple}{ ext{RoyalPurple}}}\)
\({\displaystyle \color {RubineRed}{ ext{RubineRed}}}\)
\({\displaystyle \color {Salmon}{ ext{Salmon}}}\)
\({\displaystyle \color {SeaGreen}{ ext{SeaGreen}}}\)
\({\displaystyle \color {Sepia}{ ext{Sepia}}}\)
\({\displaystyle \color {SkyBlue}{ ext{SkyBlue}}}\)
\({\displaystyle \color {SpringGreen}{ ext{SpringGreen}}}\)
\({\displaystyle \color {Tan}{ ext{Tan}}}\)
\({\displaystyle \color {TealBlue}{ ext{TealBlue}}}\)
\({\displaystyle \color {Thistle}{ ext{Thistle}}}\)
\({\displaystyle \color {Turquoise}{ ext{Turquoise}}}\)
\({\displaystyle \color {Violet}{ ext{Violet}}}\)
\({\displaystyle \color {VioletRed}{ ext{VioletRed}}}\)
\({\displaystyle \color {White}{ ext{White}}}\)
\({\displaystyle \color {WildStrawberry}{ ext{WildStrawberry}}}\)
\({\displaystyle \color {Yellow}{ ext{Yellow}}}\)
\({\displaystyle \color {YellowGreen}{ ext{YellowGreen}}}\)
\({\displaystyle \color {YellowOrange}{ ext{YellowOrange}}}\)
*注︰输入时第一个字母必需以大写输入,如。
例子
-
\({\displaystyle {\color {Blue}x^{2}}+{\color {Brown}2x}-{\color {OliveGreen}1}}\)
-
\({\displaystyle x_{\color {Maroon}1,2}={\frac {-b\pm {\sqrt {\color {Maroon}b^{2}-4ac}}}{2a}}}\)
-
一个介绍 \(\TeX\) 的 PDF 文档(英文):
-
手画符号搜索 \(\LaTeX\) 代码:
-
LaTeX 在线编辑器
-
AMS-LaTeX 指南