帮助:数学公式
在维基百科中展示公式有三种方法:原始HTML、使用数学模板的HTML(简称为{{math}})以及用HTML标记实现的LaTeX子集(本文中称为LaTeX)。每种方法都有其优点和缺点,随着时间的推移和MediaWiki的改进,这些优缺点也在不断发展。
例如,著名的爱因斯坦公式可以用以下三种方式输入:
- 原始HTML输入为
''E'' {{=}} ''mc''<sup>2</sup>,显示为 E = mc2。 - 使用{{math}},它可以输入为
{{math|''E'' {{=}} ''mc''{{sup|2}}}},显示为 E = mc2。 - 使用LaTeX,它输入为
<math>E=mc^2</math>,显示为 <math>E=mc^2</math>。
使用原始HTML[编辑]
变量名和符号在原始HTML格式下的显示效果与其他格式差异很大。当同一条目混用多种公式展示方式时,读者可能会感到困惑。特别是对于习惯阅读LaTeX的数学家来说,纯HTML的渲染效果往往难以接受。
因此,新内容通常不应使用原始HTML格式。但目前许多条目中仍保留着这种格式。最佳做法是将它们统一转换为{{math}}格式,但需要注意保持全文或至少整章格式的一致性。进行此类转换时,必须在编辑摘要中明确说明,且同一编辑中不要夹杂其他修改。这样可以帮助其他编辑识别可能存在争议的改动(因为格式转换产生的“差异”可能很大,容易掩盖其他修改)。
LaTeX与{{math}}[编辑]
这两种书写数学公式的方式各有优缺点。变量名称的呈现方式非常相似。在同一个段落中,变量名与{{math}}和<math>一起显示通常不是问题。
LaTeX的缺点如下:
- 在某些浏览器设置下,内联公式可能出现轻微垂直偏移,或字体大小与正文不匹配(块状公式和含上下标的内联公式通常不受影响)
- 含有LaTeX的章节标题和管道链接,其文字在目录和链接中无法显示为蓝色
- 指向含LaTeX公式的章节链接可能出现异常
- 大量使用LaTeX会明显增加页面加载时间
- 不建议在图片说明和脚注中使用,因为在放大图片或移动端查看时可能无法正常渲染
{{math}}的缺点包括:
- 对复杂公式的支持有限,即使能够显示,渲染效果也可能不理想
- Unicode数学符号(除基本字母数字和标点外)的显示尺寸和对齐可能不一致,特别是当回退字体不匹配时(读者的设备可能没有安装某些不常见符号的字体)
- 需要手动控制公式中的间距(如显式添加空格)
- 变量名需显式设置斜体,上下标需显式使用特定标记或模板
- 长公式的源代码标记冗长,可读性较差
使用 HTML 模板[编辑]
LaTeX标记并非渲染数学公式的唯一方法。对于简单的内联公式,模板{{math}}及其相关模板通常是首选。下表比较了两种方法可以实现相似的结果。
| TeX 语法 | TeX 渲染 | {{math}} 语法 | {{math}} 渲染 | |
|---|---|---|---|---|
<math>\alpha</math>
|
<math>\alpha</math> | {{math|''α''}} or {{mvar|α}}
|
α or α | |
<math>f(x) = x^2</math>
|
<math>f(x) = x^2</math> | {{math|1=''f''(''x'') = ''x''<sup>2</sup>}}
|
f(x) = x2 | |
<math>\{1,e,\pi\}</math>
|
<math>\{1,e,\pi\}</math> | {{math|{{mset|1, ''e'', ''π''}}}}
|
{1, e, π} | |
<math>|z| \leq 2</math>
|
z| \leq 2</math> | {{math|{{abs|''z''}} ≤ 2}}
|
|z| ≤ 2 |
以下是相关的数学模板:
HTML字符实体[编辑]
虽然通常首选Unicode字符,但有时需要使HTML字符实体来避免wiki语法问题或与其他字符混淆:
| < | > | − | • | ′ | ″ | ⋅ | · | – | — |
| < | > | − | • | ′ | ″ | ⋅ | · | – | — |
使用 LaTeX 格式化[编辑]
这里所使用的LaTeX版本是AMS-LaTeX标记的一个子集,LaTeX标记的一个超集,用于数学公式。只有TeX语言的有限的一部分得到支持。[a]
默认情况下会生成含不可见MathML的SVG图像。更老的PNG图像可通过用户设置来设置。[b]在像Firefox这样的浏览器上面可以通过安装扩展来使用MathML;详情请参阅mw:Extension:Math的扩展主页。MathJax的客户端不再被支持。
数学记号应该放在<math>与</math>的标记之间。更详细的内容,或者关于TeX显示的讨论或者您有任何建议,请到英文维基百科的相关页面。
函数、符号及特殊字符[编辑]
声调/变音符号[编辑] | |
|---|---|
\dot{a}, \ddot{a}, \acute{a}, \grave{a}
|
<math>\dot{a}, \ddot{a}, \acute{a}, \grave{a}</math> |
\check{a}, \breve{a}, \tilde{a}, \bar{a}
|
<math>\check{a}, \breve{a}, \tilde{a}, \bar{a}</math> |
\hat{a}, \widehat{a}, \vec{a}
|
<math>\hat{a}, \widehat{a}, \vec{a}</math> |
标准函数[编辑] | |
\exp_a b = a^b, \exp b = e^b, 10^m
|
<math>\exp_a b = a^b, \exp b = e^b, 10^m</math> |
\ln c, \lg d = \log e, \log_{10} f
|
<math>\ln c, \lg d = \log e, \log_{10} f</math> |
\sin a, \cos b, \tan c, \cot d, \sec e, \csc f
|
<math>\sin a, \cos b, \tan c, \cot d, \sec e, \csc f</math> |
\arcsin a, \arccos b, \arctan c
|
<math>\arcsin a, \arccos b, \arctan c</math> |
\arccot d, \arcsec e, \arccsc f
|
<math>\arccot d, \arcsec e, \arccsc f</math> |
\sinh a, \cosh b, \tanh c, \coth d
|
<math>\sinh a, \cosh b, \tanh c, \coth d</math> |
\operatorname{sh}k, \operatorname{ch}l, \operatorname{th}m, \operatorname{coth}n
|
<math>\operatorname{sh}k, \operatorname{ch}l, \operatorname{th}m, \operatorname{coth}n</math> |
\operatorname{argsh}o, \operatorname{argch}p, \operatorname{argth}q
|
<math>\operatorname{argsh}o, \operatorname{argch}p, \operatorname{argth}q</math> |
\sgn r, \left\vert s \right\vert
|
<math>\sgn r, \left\vert s \right\vert</math> |
\min(x,y), \max(x,y)
|
<math>\min(x,y), \max(x,y)</math> |
极限[编辑] | |
\min x, \max y, \inf s, \sup t
|
<math>\min x, \max y, \inf s, \sup t</math> |
\lim u, \liminf v, \limsup w
|
<math>\lim u, \liminf v, \limsup w</math> |
\dim p, \deg q, \det m, \ker\phi
|
<math>\dim p, \deg q, \det m, \ker\phi</math> |
投射[编辑] | |
\Pr j, \hom l, \lVert z \rVert, \arg z
|
<math>\Pr j, \hom l, \lVert z \rVert, \arg z</math> |
微分及导数[编辑] | |
dt, \mathrm{d}t, \partial t, \nabla\psi
|
<math>dt, \mathrm{d}t, \partial t, \nabla\psi</math> |
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
|
<math>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</math> |
\prime, \backprime, f^\prime, f', f'', f^{(3)}, \dot y, \ddot y
|
<math>\prime, \backprime, f^\prime, f', f, f^{(3)} \!, \dot y, \ddot y</math> |
类字母符号及常数[编辑] | |
\infty, \aleph, \complement, \backepsilon, \eth, \Finv, \hbar
|
<math>\infty, \aleph, \complement, \backepsilon, \eth, \Finv, \hbar</math> |
\Im, \imath, \jmath, \Bbbk, \ell, \mho, \wp, \Re, \circledS, \S, \P, \AA
|
<math>\Im, \imath, \jmath, \Bbbk, \ell, \mho, \wp, \Re, \circledS, \S, \P, \AA</math> |
模算数[编辑] | |
s_k \equiv 0 \pmod{m}
|
<math>s_k \equiv 0 \pmod{m}</math> |
a \bmod b
|
<math>a \bmod b</math> |
\gcd(m, n), \operatorname{lcm}(m, n)
|
<math>\gcd(m, n), \operatorname{lcm}(m, n)</math> |
\mid, \nmid, \shortmid, \nshortmid
|
<math>\mid, \nmid, \shortmid, \nshortmid</math> |
根号[编辑] | |
\surd, \sqrt{2}, \sqrt[n]{}, \sqrt[3]{\frac{x^3+y^3}{2}}
|
<math>\surd, \sqrt{2}, \sqrt[n]{}, \sqrt[3]{\frac{x^3+y^3}{2}}</math> |
运算符[编辑] | |
+, -, \pm, \mp, \dotplus
|
<math>+, -, \pm, \mp, \dotplus</math> |
\times, \div, \divideontimes, /, \backslash
|
<math>\times, \div, \divideontimes, /, \backslash</math> |
\cdot, * \ast, \star, \circ, \bullet
|
<math>\cdot, * \ast, \star, \circ, \bullet</math> |
\boxplus, \boxminus, \boxtimes, \boxdot
|
<math>\boxplus, \boxminus, \boxtimes, \boxdot</math> |
\oplus, \ominus, \otimes, \oslash, \odot
|
<math>\oplus, \ominus, \otimes, \oslash, \odot</math> |
\circleddash, \circledcirc, \circledast
|
<math>\circleddash, \circledcirc, \circledast</math> |
\bigoplus, \bigotimes, \bigodot
|
<math>\bigoplus, \bigotimes, \bigodot</math> |
集合[编辑] | |
\{ \}, \O \empty \emptyset, \varnothing
|
<math>\{ \}, \O \empty \emptyset, \varnothing</math> |
\in, \notin \not\in, \ni, \not\ni
|
<math>\in, \notin \not\in, \ni, \not\ni</math> |
\cap, \Cap, \sqcap, \bigcap
|
<math>\cap, \Cap, \sqcap, \bigcap</math> |
\cup, \Cup, \sqcup, \bigcup, \bigsqcup, \uplus, \biguplus
|
<math>\cup, \Cup, \sqcup, \bigcup, \bigsqcup, \uplus, \biguplus</math> |
\setminus, \smallsetminus, \times
|
<math>\setminus, \smallsetminus, \times</math> |
\subset, \Subset, \sqsubset
|
<math>\subset, \Subset, \sqsubset</math> |
\supset, \Supset, \sqsupset
|
<math>\supset, \Supset, \sqsupset</math> |
\subseteq, \nsubseteq, \subsetneq, \varsubsetneq, \sqsubseteq
|
<math>\subseteq, \nsubseteq, \subsetneq, \varsubsetneq, \sqsubseteq</math> |
\supseteq, \nsupseteq, \supsetneq, \varsupsetneq, \sqsupseteq
|
<math>\supseteq, \nsupseteq, \supsetneq, \varsupsetneq, \sqsupseteq</math> |
\subseteqq, \nsubseteqq, \subsetneqq, \varsubsetneqq
|
<math>\subseteqq, \nsubseteqq, \subsetneqq, \varsubsetneqq</math> |
\supseteqq, \nsupseteqq, \supsetneqq, \varsupsetneqq
|
<math>\supseteqq, \nsupseteqq, \supsetneqq, \varsupsetneqq</math> |
关系符号[编辑] | |
=, \ne, \neq, \equiv, \not\equiv
|
<math>=, \ne, \neq, \equiv, \not\equiv</math> |
\doteq, \doteqdot, \overset{\underset{\mathrm{def}}{}}{=}, :=
|
<math>\doteq, \doteqdot, \overset{\underset{\mathrm{def}}{}}{=}, :=</math> |
\sim, \nsim, \backsim, \thicksim, \simeq, \backsimeq, \eqsim, \cong, \ncong
|
<math>\sim, \nsim, \backsim, \thicksim, \simeq, \backsimeq, \eqsim, \cong, \ncong</math> |
\approx, \thickapprox, \approxeq, \asymp, \propto, \varpropto
|
<math>\approx, \thickapprox, \approxeq, \asymp, \propto, \varpropto</math> |
<, \nless, \ll, \not\ll, \lll, \not\lll, \lessdot
|
<math><, \nless, \ll, \not\ll, \lll, \not\lll, \lessdot</math> |
>, \ngtr, \gg, \not\gg, \ggg, \not\ggg, \gtrdot
|
<math>>, \ngtr, \gg, \not\gg, \ggg, \not\ggg, \gtrdot</math> |
\le, \leq, \lneq, \leqq, \nleq, \nleqq, \lneqq, \lvertneqq
|
<math>\le, \leq, \lneq, \leqq, \nleq, \nleqq, \lneqq, \lvertneqq</math> |
\ge, \geq, \gneq, \geqq, \ngeq, \ngeqq, \gneqq, \gvertneqq
|
<math>\ge, \geq, \gneq, \geqq, \ngeq, \ngeqq, \gneqq, \gvertneqq</math> |
\lessgtr, \lesseqgtr, \lesseqqgtr, \gtrless, \gtreqless, \gtreqqless
|
<math>\lessgtr, \lesseqgtr, \lesseqqgtr, \gtrless, \gtreqless, \gtreqqless</math> |
\leqslant, \nleqslant, \eqslantless
|
<math>\leqslant, \nleqslant, \eqslantless</math> |
\geqslant, \ngeqslant, \eqslantgtr
|
<math>\geqslant, \ngeqslant, \eqslantgtr</math> |
\lesssim, \lnsim, \lessapprox, \lnapprox
|
<math>\lesssim, \lnsim, \lessapprox, \lnapprox</math> |
\gtrsim, \gnsim, \gtrapprox, \gnapprox
|
<math>\gtrsim, \gnsim, \gtrapprox, \gnapprox</math> |
\prec, \nprec, \preceq, \npreceq, \precneqq
|
<math>\prec, \nprec, \preceq, \npreceq, \precneqq</math> |
\succ, \nsucc, \succeq, \nsucceq, \succneqq
|
<math>\succ, \nsucc, \succeq, \nsucceq, \succneqq</math> |
\preccurlyeq, \curlyeqprec
|
<math>\preccurlyeq, \curlyeqprec</math> |
\succcurlyeq, \curlyeqsucc
|
<math>\succcurlyeq, \curlyeqsucc</math> |
\precsim, \precnsim, \precapprox, \precnapprox
|
<math>\precsim, \precnsim, \precapprox, \precnapprox</math> |
\succsim, \succnsim, \succapprox, \succnapprox
|
<math>\succsim, \succnsim, \succapprox, \succnapprox</math> |
几何符号[编辑] | |
\parallel, \nparallel, \shortparallel, \nshortparallel
|
<math>\parallel, \nparallel, \shortparallel, \nshortparallel</math> |
\perp, \angle, \sphericalangle, \measuredangle, 45^\circ
|
<math>\perp, \angle, \sphericalangle, \measuredangle, 45^\circ</math> |
\Box, \blacksquare, \diamond, \Diamond \lozenge, \blacklozenge, \bigstar
|
<math>\Box, \blacksquare, \diamond, \Diamond \lozenge, \blacklozenge, \bigstar</math> |
\bigcirc, \triangle, \bigtriangleup, \bigtriangledown
|
<math>\bigcirc, \triangle, \bigtriangleup, \bigtriangledown</math> |
\vartriangle, \triangledown
|
<math>\vartriangle, \triangledown</math> |
\blacktriangle, \blacktriangledown, \blacktriangleleft, \blacktriangleright
|
<math>\blacktriangle, \blacktriangledown, \blacktriangleleft, \blacktriangleright</math> |
逻辑符号[编辑] | |
\forall, \exists, \nexists
|
<math>\forall, \exists, \nexists</math> |
\therefore, \because, \And
|
<math>\therefore, \because, \And</math> |
\or \lor \vee, \curlyvee, \bigvee
|
<math>\or, \lor, \vee, \curlyvee, \bigvee</math> |
\and \land \wedge, \curlywedge, \bigwedge
|
<math>\and, \land, \wedge, \curlywedge, \bigwedge</math> |
\bar{q}, \bar{abc}, \overline{q}, \overline{abc},
|
<math>\bar{q}, \bar{abc}, \overline{q}, \overline{abc},</math> <math>\lnot \neg, \not\operatorname{R}, \bot, \top</math> |
\vdash \dashv, \vDash, \Vdash, \models
|
<math>\vdash, \dashv, \vDash, \Vdash, \models</math> |
\Vvdash \nvdash \nVdash \nvDash \nVDash
|
<math>\Vvdash, \nvdash, \nVdash, \nvDash, \nVDash</math> |
\ulcorner \urcorner \llcorner \lrcorner
|
<math>\ulcorner \urcorner \llcorner \lrcorner</math> |
箭头[编辑] | |
\Rrightarrow, \Lleftarrow
|
<math>\Rrightarrow, \Lleftarrow</math> |
\Rightarrow, \nRightarrow, \Longrightarrow \implies
|
<math>\Rightarrow, \nRightarrow, \Longrightarrow, \implies</math> |
\Leftarrow, \nLeftarrow, \Longleftarrow
|
<math>\Leftarrow, \nLeftarrow, \Longleftarrow</math> |
\Leftrightarrow, \nLeftrightarrow, \Longleftrightarrow \iff
|
<math>\Leftrightarrow, \nLeftrightarrow, \Longleftrightarrow \iff</math> |
\Uparrow, \Downarrow, \Updownarrow
|
<math>\Uparrow, \Downarrow, \Updownarrow</math> |
\rightarrow \to, \nrightarrow, \longrightarrow
|
<math>\rightarrow \to, \nrightarrow, \longrightarrow</math> |
\leftarrow \gets, \nleftarrow, \longleftarrow
|
<math>\leftarrow \gets, \nleftarrow, \longleftarrow</math> |
\leftrightarrow, \nleftrightarrow, \longleftrightarrow
|
<math>\leftrightarrow, \nleftrightarrow, \longleftrightarrow</math> |
\uparrow, \downarrow, \updownarrow
|
<math>\uparrow, \downarrow, \updownarrow</math> |
\nearrow, \swarrow, \nwarrow, \searrow
|
<math>\nearrow, \swarrow, \nwarrow, \searrow</math> |
\mapsto, \longmapsto
|
<math>\mapsto, \longmapsto</math> |
\rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft \upharpoonright \downharpoonleft \downharpoonright \rightleftharpoons \leftrightharpoons
|
<math>\rightharpoonup, \rightharpoondown, \leftharpoonup, \leftharpoondown, \upharpoonleft, \upharpoonright, \downharpoonleft, \downharpoonright, \rightleftharpoons, \leftrightharpoons</math> |
\curvearrowleft \circlearrowleft \Lsh \upuparrows \rightrightarrows \rightleftarrows \rightarrowtail \looparrowright
|
<math>\curvearrowleft, \circlearrowleft, \Lsh, \upuparrows, \rightrightarrows, \rightleftarrows, \rightarrowtail, \looparrowright</math> |
\curvearrowright \circlearrowright \Rsh \downdownarrows \leftleftarrows \leftrightarrows \leftarrowtail \looparrowleft
|
<math>\curvearrowright, \circlearrowright, \Rsh, \downdownarrows, \leftleftarrows, \leftrightarrows, \leftarrowtail, \looparrowleft</math> |
\hookrightarrow \hookleftarrow \multimap \leftrightsquigarrow \rightsquigarrow \twoheadrightarrow \twoheadleftarrow
|
<math>\hookrightarrow, \hookleftarrow, \multimap, \leftrightsquigarrow, \rightsquigarrow, \twoheadrightarrow, \twoheadleftarrow</math> |
特殊符号[编辑] | |
\amalg \P \S \% \dagger \ddagger \ldots \cdots
|
<math>\amalg \P \S \% \dagger \ddagger \ldots \cdots</math> |
\smile \frown \wr \triangleleft \triangleright
|
<math>\smile \frown \wr \triangleleft \triangleright</math> |
\diamondsuit, \heartsuit, \clubsuit, \spadesuit, \Game, \flat, \natural, \sharp
|
<math>\diamondsuit, \heartsuit, \clubsuit, \spadesuit, \Game, \flat, \natural, \sharp</math> |
未排序[编辑] | |
\diagup \diagdown \centerdot \ltimes \rtimes \leftthreetimes \rightthreetimes
|
<math>\diagup, \diagdown, \centerdot, \ltimes, \rtimes, \leftthreetimes, \rightthreetimes</math> |
\eqcirc \circeq \triangleq \bumpeq \Bumpeq \doteqdot \risingdotseq \fallingdotseq
|
<math>\eqcirc, \circeq, \triangleq, \bumpeq, \Bumpeq, \doteqdot, \risingdotseq, \fallingdotseq</math> |
\intercal \barwedge \veebar \doublebarwedge \between \pitchfork
|
<math>\intercal, \barwedge, \veebar, \doublebarwedge, \between, \pitchfork</math> |
\vartriangleleft \ntriangleleft \vartriangleright \ntriangleright
|
<math>\vartriangleleft, \ntriangleleft, \vartriangleright, \ntriangleright</math> |
\trianglelefteq \ntrianglelefteq \trianglerighteq \ntrianglerighteq
|
<math>\trianglelefteq, \ntrianglelefteq, \trianglerighteq, \ntrianglerighteq</math> |
\not6, \frac{1\not6}{\not64}=\frac{1}{4}
|
<math>\not6, \frac{1\not6}{\not64}=\frac{1}{4}</math> |
关于这些符号的更多语义,参阅TeX Cookbook或TeX Cookbook的简述。
上标、下标及积分等[编辑]
| 功能 | 语法 | 效果 |
|---|---|---|
| 上标 | a^2 |
<math> a^2</math> |
| 下标 | a_2 |
<math> a_2</math> |
| 组合 | a^{2+2} |
<math> a^{2+2}</math> |
a_{i,j} |
<math> a_{i,j}</math> | |
| 结合上下标 | x_2^3 |
<math> x_2^3</math> |
| 前置上下标 | {}_1^2\!X_3^4 |
<math> {}_1^2\!X_3^4</math> |
| 上下标错开 | {x_1}^2=x_1 \times x_1 |
<math>{x_1}^2=x_1 \times x_1</math> |
| 导数 (HTML) |
x' |
<math> x'</math> |
| 导数 (PNG) |
x^\prime |
<math> x^\prime</math> |
| 导数 (错误) |
x\prime |
<math> x\prime</math> |
| 导数点 | \dot{x}
|
<math> \dot{x}</math> |
\ddot{y}
|
<math> \ddot{y}</math> | |
| 向量 | \vec{c}
|
<math> \vec{c}</math> |
\overleftarrow{a b}
|
<math> \overleftarrow{a b}</math> | |
\overrightarrow{c d}
|
<math> \overrightarrow{c d}</math> | |
\overleftrightarrow{a b}
|
<math> \overleftrightarrow{a b}</math> | |
\widehat{e f g}
|
<math> \widehat{e f g}</math> | |
| 上弧 (注: 正确应该用 \overarc,但在这里行不通。要用建议的语法作为解决办法。)(使用\overarc时需要引入{arcs}包。) |
\overset{\frown} {AB}
|
<math> \overset{\frown} {AB}</math> |
| 上划线 | \overline{h i j}
|
<math> \overline{h i j}</math> |
| 下划线 | \underline{k l m}
|
<math> \underline{k l m}</math> |
| 上括号 | \overbrace{1+2+\cdots+100}
|
<math> \overbrace{1+2+\cdots+100}</math> |
\overbrace{ 1+2+\cdots+100 }^{5050}
|
<math>\overbrace{ 1+2+\cdots+100 }^{5050}</math> | |
| 下括号 | \underbrace{a+b+\cdots+z}
|
<math> \underbrace{a+b+\cdots+z}</math> |
\underbrace{ a+b+\cdots+z }_{26}
|
<math>\underbrace{ a+b+\cdots+z }_{26}</math> | |
| 求和 | \sum_{k=1}^N k^2 |
<math> \sum_{k=1}^N k^2</math> |
\begin{matrix} \sum_{k=1}^N k^2 \end{matrix} |
<math> \begin{matrix} \sum_{k=1}^N k^2 \end{matrix}</math> | |
| 求积 | \prod_{i=1}^N x_i |
<math> \prod_{i=1}^N x_i</math> |
\begin{matrix} \prod_{i=1}^N x_i \end{matrix} |
<math> \begin{matrix} \prod_{i=1}^N x_i \end{matrix}</math> | |
| 上积 | \coprod_{i=1}^N x_i |
<math> \coprod_{i=1}^N x_i</math> |
\begin{matrix} \coprod_{i=1}^N x_i \end{matrix} |
<math> \begin{matrix} \coprod_{i=1}^N x_i \end{matrix}</math> | |
| 极限 | \lim_{n \to \infty}x_n |
<math> \lim_{n \to \infty}x_n</math> |
\begin{matrix} \lim_{n \to \infty}x_n \end{matrix} |
<math> \begin{matrix} \lim_{n \to \infty}x_n \end{matrix}</math> | |
| 积分 | \int_{-N}^{N} e^x\, \mathrm{d}x |
<math> \int_{-N}^{N} e^x\, \mathrm{d}x</math> |
\begin{matrix} \int_{-N}^{N} e^x\, \mathrm{d}x \end{matrix} |
<math> \begin{matrix} \int_{-N}^{N} e^x\, \mathrm{d}x \end{matrix}</math> | |
| 双重积分 | \iint_{D}^{W} \, \mathrm{d}x\,\mathrm{d}y |
<math> \iint_{D}^{W} \, \mathrm{d}x\,\mathrm{d}y</math> |
| 三重积分 | \iiint_{E}^{V} \, \mathrm{d}x\,\mathrm{d}y\,\mathrm{d}z |
<math> \iiint_{E}^{V} \, \mathrm{d}x\,\mathrm{d}y\,\mathrm{d}z</math> |
| 四重积分 | \iiiint_{F}^{U} \, \mathrm{d}x\,\mathrm{d}y\,\mathrm{d}z\,\mathrm{d}t |
<math> \iiiint_{F}^{U} \, \mathrm{d}x\,\mathrm{d}y\,\mathrm{d}z\,\mathrm{d}t</math> |
| 闭合的曲线积分、曲面积分 | \oint_{C} x^3\, \mathrm{d}x + 4y^2\, \mathrm{d}y |
<math> \oint_{C} x^3\, \mathrm{d}x + 4y^2\, \mathrm{d}y</math> |
| 顺时针的闭合曲线积分、曲面积分 | \varointclockwise_{C} 7^x\, \mathrm{d}x + e^y\, \mathrm{d}y |
<math> \varointclockwise_{C} 7^x\, \mathrm{d}x + e^y\, \mathrm{d}y</math> |
| 逆时针的闭合曲线积分、曲面积分 | \ointctrclockwise_{C} 7^x\, \mathrm{d}x + e^y\, \mathrm{d}y |
<math> \ointctrclockwise_{C} 7^x\, \mathrm{d}x + e^y\, \mathrm{d}y</math> |
| 闭合面积分 | \oiint_{S} \,f\mathrm{d}A |
<math> \oiint_{S} 7^x\,f\mathrm{d}A</math> |
| 闭合体积分 | \oiiint_{E}\,f\mathrm{d}V |
<math>\oiiint_{E} 7^x\,f\mathrm{d}V</math> |
| 交集 | \bigcap_1^{n} p |
<math> \bigcap_1^{n} p</math> |
| 并集 | \bigcup_1^{k} p |
<math> \bigcup_1^{k} p</math> |
分数、矩阵和多行列式[编辑]
| 功能 | 语法 | 效果 |
|---|---|---|
| 分数 | \frac{2}{4}=0.5 |
<math>\frac{2}{4}=0.5</math> |
{2 \over 3} |
<math>{2 \over 3}</math> | |
{{a+b} \over {a-b}} |
<math>{{a+b} \over {a-b}}</math> | |
| 小型分数 | \tfrac{2}{4} = 0.5
|
<math>\tfrac{2}{4} = 0.5</math> |
| 大型分数(嵌套) | \cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a
|
<math>\cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a</math> |
| 大型分数(不嵌套) | \dfrac{2}{4} = 0.5 \qquad \dfrac{2}{c + \dfrac{2}{d + \dfrac{2}{4}}} = a
|
<math>\dfrac{2}{4} = 0.5 \qquad \dfrac{2}{c + \dfrac{2}{d + \dfrac{2}{4}}} = a</math> |
| 二项式系数 | \dbinom{n}{r}=\binom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}
|
<math>\dbinom{n}{r}=\binom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}</math> |
n \choose n-r, n^2 \choose r_1, a-b \choose c+d, {n \choose 0}+{n \choose 1}
|
<math>n \choose n-r</math> <math>n^2 \choose r_1</math> <math>a-b \choose c+d</math> <math>{n \choose 0}+{n \choose 1}</math> | |
| 小型二项式系数 | \tbinom{n}{r}=\tbinom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}
|
<math>\tbinom{n}{r}=\tbinom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}</math> |
| 大型二项式系数 | \binom{n}{r}=\dbinom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}
|
<math>\binom{n}{r}=\dbinom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}</math> |
| 矩阵 | \begin{matrix}
x & y \\
z & v
\end{matrix}
|
<math>\begin{matrix} x & y \\ z & v
\end{matrix}</math> |
\begin{vmatrix}
x & y \\
z & v
\end{vmatrix}
|
<math>\begin{vmatrix} x & y \\ z & v
\end{vmatrix}</math> | |
\begin{Vmatrix}
x & y \\
z & v
\end{Vmatrix}
|
<math>\begin{Vmatrix} x & y \\ z & v
\end{Vmatrix}</math> | |
\begin{bmatrix}
0 & \cdots & 0 \\
\vdots & \ddots & \vdots \\
0 & \cdots & 0
\end{bmatrix}
|
<math>\begin{bmatrix} 0 & \cdots & 0 \\ \vdots
& \ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix} </math> | |
\begin{Bmatrix}
x & y \\
z & v
\end{Bmatrix}
|
<math>\begin{Bmatrix} x & y \\ z & v
\end{Bmatrix}</math> | |
\begin{pmatrix}
x & y \\
z & v
\end{pmatrix}
|
<math>\begin{pmatrix} x & y \\ z & v
\end{pmatrix}</math> | |
\bigl( \begin{smallmatrix}
a&b\\ c&d
\end{smallmatrix} \bigr)
|
<math>
\bigl( \begin{smallmatrix} a&b\\ c&d \end{smallmatrix} \bigr) </math> | |
| 条件定义 | f(n) =
\begin{cases}
n/2, & \mbox{if }n\mbox{ is even} \\
3n+1, & \mbox{if }n\mbox{ is odd}
\end{cases}
|
<math>f(n) =
\begin{cases} n/2, & \mbox{if }n\mbox{ is even} \\ 3n+1, & \mbox{if }n\mbox{ is odd} \end{cases} </math> |
| 多行等式、同余式 | \begin{align}
f(x) & = (m+n)^2 \\
& = m^2+2mn+n^2 \\
\end{align}
|
<math>
\begin{align} f(x) & = (m+n)^2 \\ & = m^2+2mn+n^2 \\ \end{align} </math> |
\begin{align}
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{align}
|
<math>\begin{align}
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{align}</math> | |
\begin{alignat}{3}
f(x) & = (m-n)^2 \\
f(x) & = (-m+n)^2 \\
& = m^2-2mn+n^2 \\
\end{alignat}
|
<math>
\begin{alignat}{3} f(x) & = (m-n)^2 \\ f(x) & = (-m+n)^2 \\ & = m^2-2mn+n^2 \\ \end{alignat} </math> | |
| 多行等式(左对齐) | \begin{array}{lcl}
z & = & a \\
f(x,y,z) & = & x + y + z
\end{array}
|
<math>\begin{array}{lcl}
z & = & a \\ f(x,y,z) & = & x + y + z \end{array}</math> |
| 多行等式(右对齐) | \begin{array}{lcr}
z & = & a \\
f(x,y,z) & = & x + y + z
\end{array}
|
<math>\begin{array}{lcr}
z & = & a \\ f(x,y,z) & = & x + y + z \end{array}</math> |
| 长公式换行 |
<math>f(x) \,\!</math>
<math>= \sum_{n=0}^\infty a_n x^n </math>
<math>= a_0+a_1x+a_2x^2+\cdots</math>
|
<math>f(x) \,\!</math><math>= \sum_{n=0}^\infty a_n x^n </math><math>= a_0 +a_1x+a_2x^2+\cdots</math> |
| 方程组 | \begin{cases}
3x + 5y + z \\
7x - 2y + 4z \\
-6x + 3y + 2z
\end{cases}
|
<math>\begin{cases} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \end{cases}</math> |
| 数组 | \begin{array}{|c|c||c|} a & b & S \\
\hline
0&0&1\\
0&1&1\\
1&0&1\\
1&1&0\\
\end{array}
|
<math>
\begin{array}{|c|c||c|} a & b & S \\ \hline 0&0&1\\ 0&1&1\\ 1&0&1\\ 1&1&0\\ \end{array} </math> |
字体[编辑]
| 希腊字母 | |
|---|---|
\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta
|
<math>\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta</math> |
\Iota \Kappa \Lambda \Mu \Nu \Xi \Omicron \Pi
|
<math>\Iota \Kappa \Lambda \Mu \Nu \Xi \Omicron \Pi</math> |
\Rho \Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega
|
<math>\Rho \Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega</math> |
\alpha \beta \gamma \delta \epsilon \zeta \eta \theta
|
<math>\alpha \beta \gamma \delta \epsilon \zeta \eta \theta</math> |
\iota \kappa \lambda \mu \nu \xi \omicron \pi
|
<math>\iota \kappa \lambda \mu \nu \xi \omicron \pi</math> |
\rho \sigma \tau \upsilon \phi \chi \psi \omega
|
<math>\rho \sigma \tau \upsilon \phi \chi \psi \omega</math> |
\varepsilon \digamma \varkappa \varpi
|
<math>\varepsilon \digamma \varkappa \varpi</math> |
\varrho \varsigma \vartheta \varphi
|
<math>\varrho \varsigma \vartheta \varphi</math> |
| 希伯来符号 | |
\aleph \beth \gimel \daleth
|
<math>\aleph \beth \gimel \daleth</math> |
| 黑板报粗体 | |
\mathbb{ABCDEFGHI}
|
<math>\mathbb{ABCDEFGHI}</math> |
\mathbb{JKLMNOPQR}
|
<math>\mathbb{JKLMNOPQR}</math> |
\mathbb{STUVWXYZ}
|
<math>\mathbb{STUVWXYZ}</math> |
| 粗体 | |
\mathbf{ABCDEFGHI}
|
<math>\mathbf{ABCDEFGHI}</math> |
\mathbf{JKLMNOPQR}
|
<math>\mathbf{JKLMNOPQR}</math> |
\mathbf{STUVWXYZ}
|
<math>\mathbf{STUVWXYZ}</math> |
\mathbf{abcdefghijklm}
|
<math>\mathbf{abcdefghijklm}</math> |
\mathbf{nopqrstuvwxyz}
|
<math>\mathbf{nopqrstuvwxyz}</math> |
\mathbf{0123456789}
|
<math>\mathbf{0123456789}</math> |
| 粗体希腊字母 | |
\boldsymbol{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta}
|
<math>\boldsymbol{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta}</math> |
\boldsymbol{\Iota\Kappa\Lambda\Mu\Nu\Xi\Pi\Rho}
|
<math>\boldsymbol{\Iota\Kappa\Lambda\Mu\Nu\Xi\Pi\Rho}</math> |
\boldsymbol{\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega}
|
<math>\boldsymbol{\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega}</math> |
\boldsymbol{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta}
|
<math>\boldsymbol{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta}</math> |
\boldsymbol{\iota\kappa\lambda\mu\nu\xi\pi\rho}
|
<math>\boldsymbol{\iota\kappa\lambda\mu\nu\xi\pi\rho}</math> |
\boldsymbol{\sigma\tau\upsilon\phi\chi\psi\omega}
|
<math>\boldsymbol{\sigma\tau\upsilon\phi\chi\psi\omega}</math> |
\boldsymbol{\varepsilon\digamma\varkappa\varpi}
|
<math>\boldsymbol{\varepsilon\digamma\varkappa\varpi}</math> |
\boldsymbol{\varrho\varsigma\vartheta\varphi}
|
<math>\boldsymbol{\varrho\varsigma\vartheta\varphi}</math> |
| 斜体(拉丁字母默认) | |
\mathit{0123456789}
|
<math>\mathit{0123456789}</math> |
| 斜体希腊字母(小写字母默认) | |
\mathit{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta}
|
<math>\mathit{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta}</math> |
\mathit{\Iota\Kappa\Lambda\Mu\Nu\Xi\Pi\Rho}
|
<math>\mathit{\Iota\Kappa\Lambda\Mu\Nu\Xi\Pi\Rho}</math> |
\mathit{\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega}
|
<math>\mathit{\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega}</math> |
| 罗马体 | |
\mathrm{ABCDEFGHI}
|
<math>\mathrm{ABCDEFGHI}</math> |
\mathrm{JKLMNOPQR}
|
<math>\mathrm{JKLMNOPQR}</math> |
\mathrm{STUVWXYZ}
|
<math>\mathrm{STUVWXYZ}</math> |
\mathrm{abcdefghijklm}
|
<math>\mathrm{abcdefghijklm}</math> |
\mathrm{nopqrstuvwxyz}
|
<math>\mathrm{nopqrstuvwxyz}</math> |
\mathrm{0123456789}
|
<math>\mathrm{0123456789}</math> |
| 无衬线体 | |
\mathsf{ABCDEFGHI}
|
<math>\mathsf{ABCDEFGHI}</math> |
\mathsf{JKLMNOPQR}
|
<math>\mathsf{JKLMNOPQR}</math> |
\mathsf{STUVWXYZ}
|
<math>\mathsf{STUVWXYZ}</math> |
\mathsf{abcdefghijklm}
|
<math>\mathsf{abcdefghijklm}</math> |
\mathsf{nopqrstuvwxyz}
|
<math>\mathsf{nopqrstuvwxyz}</math> |
\mathsf{0123456789}
|
<math>\mathsf{0123456789}</math> |
| 无衬线体希腊字母(仅大写) | |
\mathsf{\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta}
|
<math>\mathsf{\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta}</math> |
\mathsf{\Iota \Kappa \Lambda \Mu \Nu \Xi \Pi \Rho}
|
<math>\mathsf{\Iota \Kappa \Lambda \Mu \Nu \Xi \Pi \Rho}</math> |
\mathsf{\Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega}
|
<math>\mathsf{\Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega}</math> |
| 手写体/花体 | |
\mathcal{ABCDEFGHI}
|
<math>\mathcal{ABCDEFGHI}</math> |
\mathcal{JKLMNOPQR}
|
<math>\mathcal{JKLMNOPQR}</math> |
\mathcal{STUVWXYZ}
|
<math>\mathcal{STUVWXYZ}</math> |
| Fraktur体 | |
\mathfrak{ABCDEFGHI}
|
<math>\mathfrak{ABCDEFGHI}</math> |
\mathfrak{JKLMNOPQR}
|
<math>\mathfrak{JKLMNOPQR}</math> |
\mathfrak{STUVWXYZ}
|
<math>\mathfrak{STUVWXYZ}</math> |
\mathfrak{abcdefghijklm}
|
<math>\mathfrak{abcdefghijklm}</math> |
\mathfrak{nopqrstuvwxyz}
|
<math>\mathfrak{nopqrstuvwxyz}</math> |
\mathfrak{0123456789}
|
<math>\mathfrak{0123456789}</math> |
| 小型手写体 | |
{\scriptstyle\text{abcdefghijklm}}
|
<math>{\scriptstyle\text{abcdefghijklm}}</math> |
混合字体[编辑]
| 特征 | 语法 | 渲染效果 |
|---|---|---|
| 斜体字符(忽略空格) | x y z
|
<math>x y z</math> |
| 非斜体字符 | \text{x y z}
|
<math>\text{x y z}</math> |
| 混合斜体(差) | \text{if} n \text{is even}
|
<math>\text{if} n \text{is even}</math> |
| 混合斜体(好) | \text{if }n\text{ is even}
|
<math>\text{if }n\text{ is even}</math> |
| 混合斜体( 替代品:~ 或者"\ "强制空格) | \text{if}~n\ \text{is even}
|
<math>\text{if}~n\ \text{is even}</math> |
括号、方括号和竖线[编辑]
| 功能 | 语法 | 显示 |
|---|---|---|
| 短括号 | ( \frac{1}{2} )^n |
<math>( \frac{1}{2} )^n</math> |
| 长括号 | \left ( \frac{1}{2} \right )^n
|
<math>\left ( \frac{1}{2} \right )^n</math> |
您可以使用 \left 和 \right 来显示不同的括号:
| 功能 | 语法 | 显示 |
|---|---|---|
| 圆括号,小括号 | \left ( \frac{a}{b} \right )
|
<math>\left ( \frac{a}{b} \right )</math> |
| 方括号,中括号 | \left [ \frac{a}{b} \right ] \quad\left \lbrack \frac{a}{b} \right \rbrack
|
<math>\left [ \frac{a}{b} \right ] \quad \left \lbrack \frac{a}{b} \right \rbrack</math> |
| 花括号,大括号 | \left \{ \frac{a}{b} \right \} \quad\left \lbrace \frac{a}{b} \right \rbrace
|
<math>\left \{ \frac{a}{b} \right \} \quad \left \lbrace \frac{a}{b} \right \rbrace</math> |
| 尖括号 | \left \langle \frac{a}{b} \right \rangle
|
<math>\left \langle \frac{a}{b} \right \rangle</math> |
| 单竖线、绝对值 | \left | \frac{a}{b} \right \vert \quad
|
\frac{a}{b} \right \vert \quad </math> |
| 双竖线,范数 | \left \Vert \frac{c}{d} \right \| |
</math> |
| 取整函数、高斯符号 | \left \lfloor \frac{a}{b} \right \rfloor \quad\left \lceil \frac{c}{d} \right \rceil
|
<math>\left \lfloor \frac{a}{b} \right \rfloor \quad \left \lceil \frac{c}{d} \right \rceil</math> |
| 斜线和反斜线 | \left / \frac{a}{b} \right \backslash
|
<math>\left / \frac{a}{b} \right \backslash</math> |
| 上箭头、下箭头和上下箭头 | \left \uparrow \frac{a}{b} \right \downarrow \quad\left \Uparrow \frac{a}{b} \right \Downarrow \quad\left \updownarrow \frac{a}{b} \right \Updownarrow
|
<math>\left \uparrow \frac{a}{b} \right \downarrow \quad \left \Uparrow \frac{a}{b} \right \Downarrow \quad \left \updownarrow \frac{a}{b} \right \Updownarrow</math> |
| 可以混合使用定界符, 只要\left和\right匹配 |
\left [ 0,1 \right )\left \langle \psi \right |
|
</math> |
使用\left.和\right.如果不希望显示定界符 |
\left . \frac{A}{B} \right \} \to X
|
<math>\left . \frac{A}{B} \right \} \to X</math> |
| 定界符的大小(添加"l"或"r"以指示正确间距的一侧) | ( \bigl( \Bigl( \biggl( \Biggl( \dots \Biggr] \biggr] \Bigr] \bigr] ]
|
<math>( \bigl( \Bigl( \biggl( \Biggl( \dots \Biggr] \biggr] \Bigr] \bigr] ]</math> |
\{ \bigl\{ \Bigl\{ \biggl\{ \Biggl\{ \dots\Biggr\rangle \biggr\rangle \Bigr\rangle \bigr\rangle \rangle
|
<math>\{ \bigl\{ \Bigl\{ \biggl\{ \Biggl\{ \dots \Biggr\rangle \biggr\rangle \Bigr\rangle \bigr\rangle \rangle</math> | |
\| \big\| \Big\| \bigg\| \Bigg\| \dots \Bigg| \bigg| \Big| \big| |
|
\big\| \Big\| \bigg\| \Bigg\| \dots \Bigg| \bigg| \Big| \big| |</math> | |
\lfloor \bigl\lfloor \Bigl\lfloor \biggl\lfloor \Biggl\lfloor \dots\Biggr\rceil \biggr\rceil \Bigr\rceil \bigr\rceil \ceil
|
<math>\lfloor \bigl\lfloor \Bigl\lfloor \biggl\lfloor \Biggl\lfloor \dots \Biggr\rceil \biggr\rceil \Bigr\rceil \bigr\rceil \rceil</math> | |
\uparrow \big\uparrow \Big\uparrow \bigg\uparrow \Bigg\uparrow \dots\Bigg\Downarrow \bigg\Downarrow \Big\Downarrow \big\Downarrow \Downarrow
|
<math>\uparrow \big\uparrow \Big\uparrow \bigg\uparrow \Bigg\uparrow \dots \Bigg\Downarrow \bigg\Downarrow \Big\Downarrow \big\Downarrow \Downarrow</math> | |
\updownarrow \big\updownarrow \Big\updownarrow \bigg\updownarrow \Bigg\updownarrow \dots\Bigg\Updownarrow \bigg\Updownarrow \Big\Updownarrow \big\Updownarrow \Updownarrow
|
<math>\updownarrow \big\updownarrow \Big\updownarrow \bigg\updownarrow \Bigg\updownarrow \dots \Bigg\Updownarrow \bigg\Updownarrow \Big\Updownarrow \big\Updownarrow \Updownarrow</math> | |
/ \big/ \Big/ \bigg/ \Bigg/ \dots\Bigg\backslash \bigg\backslash \Big\backslash \big\backslash \backslash
|
<math>/ \big/ \Big/ \bigg/ \Bigg/ \dots \Bigg\backslash \bigg\backslash \Big\backslash \big\backslash \backslash</math> |
备注:
- 可以使用
\big, \Big, \bigg, \Bigg控制括号的大小,比如代码
\Bigg ( \bigg [ \Big \{ \big \langle \left | \| \frac{a}{b} \| \right | \big \rangle \Big \} \bigg ] \Bigg )
显示︰
- <math>\Bigg ( \bigg [ \Big \{ \big \langle \left | \| \frac{a}{b} \| \right | \big \rangle \Big \} \bigg ] \Bigg )</math>
空格[编辑]
注意TeX能够自动处理大多数的空格,但是您有时候需要自己来控制。
| 功能 | 语法 | 显示 | 宽度 |
|---|---|---|---|
| 2个quad空格 | \alpha\qquad\beta
|
<math>\alpha\qquad\beta</math> | <math>2m\ </math> |
| quad空格 | \alpha\quad\beta
|
<math>\alpha\quad\beta</math> | <math>m\ </math> |
| 大空格 | \alpha\ \beta
|
<math>\alpha\ \beta</math> | <math>\frac{m}{3}</math> |
| 中等空格 | \alpha\;\beta
|
<math>\alpha\;\beta</math> | <math>\frac{2m}{7}</math> |
| 小空格 | \alpha\,\beta
|
<math>\alpha\,\beta</math> | <math>\frac{m}{6}</math> |
| 没有空格 | \alpha\beta
|
<math>\alpha\beta\ </math> | <math>0\ </math> |
| 紧贴 | \alpha\!\beta
|
<math>\alpha\!\beta</math> | <math>-\frac{m}{6}</math> |
颜色[编辑]
- 语法
- 字体颜色︰
{\color{色调}表达式} 背景颜色︰[c]{\pagecolor{色调}表达式}
| <math>\color{Apricot}\text{Apricot}</math> | <math>\color{Aquamarine}\text{Aquamarine}</math> | <math>\color{Bittersweet}\text{Bittersweet}</math> | <math>\color{Black}\text{Black}</math> |
| <math>\color{Blue}\text{Blue}</math> | <math>\color{BlueGreen}\text{BlueGreen}</math> | <math>\color{BlueViolet}\text{BlueViolet}</math> | <math>\color{BrickRed}\text{BrickRed}</math> |
| <math>\color{Brown}\text{Brown}</math> | <math>\color{BurntOrange}\text{BurntOrange}</math> | <math>\color{CadetBlue}\text{CadetBlue}</math> | <math>\color{CarnationPink}\text{CarnationPink}</math> |
| <math>\color{Cerulean}\text{Cerulean}</math> | <math>\color{CornflowerBlue}\text{CornflowerBlue}</math> | <math>\color{Cyan}\text{Cyan}</math> | <math>\color{Dandelion}\text{Dandelion}</math> |
| <math>\color{DarkOrchid}\text{DarkOrchid}</math> | <math>\color{Emerald}\text{Emerald}</math> | <math>\color{ForestGreen}\text{ForestGreen}</math> | <math>\color{Fuchsia}\text{Fuchsia}</math> |
| <math>\color{Goldenrod}\text{Goldenrod}</math> | <math>\color{Gray}\text{Gray}</math> | <math>\color{Green}\text{Green}</math> | <math style="background:gray">\color{GreenYellow}\text{GreenYellow}</math> |
| <math>\color{JungleGreen}\text{JungleGreen}</math> | <math>\color{Lavender}\text{Lavender}</math> | <math>\color{LimeGreen}\text{LimeGreen}</math> | <math>\color{Magenta}\text{Magenta}</math> |
| <math>\color{Mahogany}\text{Mahogany}</math> | <math>\color{Maroon}\text{Maroon}</math> | <math>\color{Melon}\text{Melon}</math> | <math>\color{MidnightBlue}\text{MidnightBlue}</math> |
| <math>\color{Mulberry}\text{Mulberry}</math> | <math>\color{NavyBlue}\text{NavyBlue}</math> | <math>\color{OliveGreen}\text{OliveGreen}</math> | <math>\color{Orange}\text{Orange}</math> |
| <math>\color{OrangeRed}\text{OrangeRed}</math> | <math>\color{Orchid}\text{Orchid}</math> | <math>\color{Peach}\text{Peach}</math> | <math>\color{Periwinkle}\text{Periwinkle}</math> |
| <math>\color{PineGreen}\text{PineGreen}</math> | <math>\color{Plum}\text{Plum}</math> | <math>\color{ProcessBlue}\text{ProcessBlue}</math> | <math>\color{Purple}\text{Purple}</math> |
| <math>\color{RawSienna}\text{RawSienna}</math> | <math>\color{Red}\text{Red}</math> | <math>\color{RedOrange}\text{RedOrange}</math> | <math>\color{RedViolet}\text{RedViolet}</math> |
| <math>\color{Rhodamine}\text{Rhodamine}</math> | <math>\color{RoyalBlue}\text{RoyalBlue}</math> | <math>\color{RoyalPurple}\text{RoyalPurple}</math> | <math>\color{RubineRed}\text{RubineRed}</math> |
| <math>\color{Salmon}\text{Salmon}</math> | <math>\color{SeaGreen}\text{SeaGreen}</math> | <math>\color{Sepia}\text{Sepia}</math> | <math>\color{SkyBlue}\text{SkyBlue}</math> |
| <math style="background:gray">\color{SpringGreen}\text{SpringGreen}</math> | <math>\color{Tan}\text{Tan}</math> | <math>\color{TealBlue}\text{TealBlue}</math> | <math>\color{Thistle}\text{Thistle}</math> |
| <math>\color{Turquoise}\text{Turquoise}</math> | <math>\color{Violet}\text{Violet}</math> | <math>\color{VioletRed}\text{VioletRed}</math> | <math style="background:black">\color{White}\text{White}</math> |
| <math>\color{WildStrawberry}\text{WildStrawberry}</math> | <math style="background:gray">\color{Yellow}\text{Yellow}</math> | <math>\color{YellowGreen}\text{YellowGreen}</math> | <math>\color{YellowOrange}\text{YellowOrange}</math> |
*注︰输入时第一个字母必需以大写输入,如\color{OliveGreen}。
- 例子
{\color{Blue}x^2}+{\color{Brown}2x} - {\color{OliveGreen}1}
- <math> {\color{Blue}x^2}+{\color{Brown}2x} - {\color{OliveGreen}1}</math>
x_{\color{Maroon}1,2}=\frac{-b\pm\sqrt{{\color{Maroon}b^2-4ac}}}{2a}
- <math style="background:#F8FCFF"> x_{\color{Maroon}1,2}=\frac{-b\pm\sqrt{{\color{Maroon}b^2-4ac}}}{2a}</math>
注释[编辑]
- ^ 虽然在所有情况下,TeX是由编译器而不是解释器生成,在高德纳的TeX或兰波特的LaTeX及现有的实现之间存在着一个基本的区别:前两种情况下编译器产生“一体化”的可打印的输出成果,有着拥有全部章节的书籍的质量,没有一行是“特殊的”,现有的实现通常有着用于公式的TeX图像(更准确的说:PNG图像)的混合,嵌入一般的文本中,并含有简短的TeX元素常常被HTML部分取代。作为结果,多数情况下的TeX元素,如向量符号、伸出文本行的下方(或上方)的部分。这个“伸出”的部分不是上文中所提到情况下的原始产物,而且用于小号TeX附件到文本的HTML替代对于许多读者来说常常在质量上是不够充分的。虽然存在这些缺陷,以“最多嵌入的PNG图像”为特性的当前产物应该推荐使用于小号文本,在那里公式不是最主要的。
- ^ 这个会造成的设置垂直对齐时的基线时的一些困难也会成为问题(参阅bug 32694)
- ^ 该命令已失效,参见Phabricator
参考资料[编辑]
外部链接[编辑]
- 一个介绍TeX的PDF文档(英文): http://www.ctan.org/tex-archive/info/gentle/gentle.pdf
- 手画符号搜索LaTeX代码: Detexify
- LaTeX在线编辑器
- LaTeX在线编辑器:latexlive
- LaTeX for Logicians
- AMS-LaTeX指南