說明:數學公式
在維基百科中展示公式有三種方法:原始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指南