LATEX 的数学公式有两种:行中公式和独立公式(行间公式)。行中公式放在文中与其它文字混编,独立公式单独成行。
行中公式可以用如下方法表示:
$ 数学公式 $
独立公式可以用如下方法表示:
$$ 数学公式 $$
1.函数、符号以及特殊字符
声调/变音符号
\dot{a},\ddot{a},\acute{a},\grave{a}
a ˙ , a ¨ , a ˊ , a ˋ \dot{a},\ddot{a},\acute{a},\grave{a} a˙,a¨,aˊ,aˋ
\check{a}, \breve{a}, \tilde{a}, \bar{a}
a ˇ , a ˘ , a ~ , a ˉ \check{a}, \breve{a}, \tilde{a}, \bar{a} aˇ,a˘,a~,aˉ
\hat{a}, \widehat{a}, \vec{a}
a ^ , a ^ , a ⃗ \hat{a}, \widehat{a}, \vec{a} a^,a ,a
标准函数
指数:
\exp_a b = a^b, \exp b = e^b, 10^m
exp
a
b
=
a
b
,
exp
b
=
e
b
,
1
0
m
\exp_a b = a^b, \exp b = e^b, 10^m
expab=ab,expb=eb,10m
对数:
\ln c, \lg d = \log e, \log_{10} f
ln
c
,
lg
d
=
log
e
,
log
10
f
\ln c, \lg d = \log e, \log_{10} f
lnc,lgd=loge,log10f
三角函数:
\sin a, \cos b, \tan c, \cot d, \sec e, \csc f
sin a , cos b , tan c , cot d , sec e , csc f \sin a, \cos b, \tan c, \cot d, \sec e, \csc f sina,cosb,tanc,cotd,sece,cscf
\arcsin a, \arccos b, \arctan c
arcsin a , arccos b , arctan c \arcsin a, \arccos b, \arctan c arcsina,arccosb,arctanc
\arccot d, \arcsec e, \arccsc f
KaTeX parse error: Undefined control sequence: \arccot at position 1: \̲a̲r̲c̲c̲o̲t̲ ̲d, \arcsec e, \…
\sinh a, \cosh b, \tanh c, \coth d
sinh a , cosh b , tanh c , coth d \sinh a, \cosh b, \tanh c, \coth d sinha,coshb,tanhc,cothd
\operatorname{sh}k, \operatorname{ch}l, \operatorname{th}m, \operatorname{coth}n
sh k , ch l , th m , coth n \operatorname{sh}k, \operatorname{ch}l, \operatorname{th}m, \operatorname{coth}n shk,chl,thm,cothn
\operatorname{argsh}o, \operatorname{argch}p, \operatorname{argth}q
argsh o , argch p , argth q \operatorname{argsh}o, \operatorname{argch}p, \operatorname{argth}q argsho,argchp,argthq
符号函数,绝对值
\left\vert s \right\vert
∣
s
∣
\left\vert s \right\vert
∣s∣
最大值,最小值
\min(x,y), \max(x,y)
min ( x , y ) , max ( x , y ) \min(x,y), \max(x,y) min(x,y),max(x,y)
界限,极限
\min x, \max y, \inf s, \sup t
min x , max y , inf s , sup t \min x, \max y, \inf s, \sup t minx,maxy,infs,supt
\lim u, \liminf v, \limsup w
lim u , lim inf v , lim sup w \lim u, \liminf v, \limsup w limu,liminfv,limsupw
\lim_{x \to \infty} \frac{1}{n(n+1)}
lim x → ∞ 1 n ( n + 1 ) \lim_{x \to \infty} \frac{1}{n(n+1)} limx→∞n(n+1)1
\dim p, \deg q, \det m, \ker\phi
dim p , deg q , det m , ker ϕ \dim p, \deg q, \det m, \ker\phi dimp,degq,detm,kerϕ
投射:
\Pr j, \hom l, \lVert z \rVert, \arg z
Pr j , hom l , ∥ z ∥ , arg z \Pr j, \hom l, \lVert z \rVert, \arg z Prj,homl,∥z∥,argz
微分,导数
dt, \mathrm{d}t, \partial t, \nabla\psi
d t , d t , ∂ t , ∇ ψ dt, \mathrm{d}t, \partial t, \nabla\psi dt,dt,∂t,∇ψ
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
d y / d x , d y / d x , d y d x , d y d x , ∂ 2 ∂ x 1 ∂ x 2 y 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 dy/dx,dy/dx,dxdy,dxdy,∂x1∂x2∂2y
\prime, \backprime, f^\prime, f', f'', f^{(3)}, \dot y, \ddot y
′
,
‵
,
f
′
,
f
′
,
f
′
′
,
f
(
3
)
,
y
˙
,
y
¨
\prime, \backprime, f^\prime, f', f'', f^{(3)}, \dot y, \ddot y
′,‵,f′,f′,f′′,f(3),y˙,y¨
类字母符号及常数
\infty, \aleph, \complement, \backepsilon, \eth, \Finv, \hbar
∞ , ℵ , ∁ , ∍ , ð , Ⅎ , ℏ \infty, \aleph, \complement, \backepsilon, \eth, \Finv, \hbar ∞,ℵ,∁,∍,ð,Ⅎ,ℏ
\Im, \imath, \jmath, \Bbbk, \ell, \mho, \wp, \Re, \circledS
ℑ
,
ı
,
ȷ
,
k
,
ℓ
,
℧
,
℘
,
ℜ
,
Ⓢ
\Im, \imath, \jmath, \Bbbk, \ell, \mho, \wp, \Re, \circledS
ℑ,ı,ȷ,k,ℓ,℧,℘,ℜ,Ⓢ
模运算
s_k \equiv 0 \pmod{m}
s k ≡ 0 ( m o d m ) s_k \equiv 0 \pmod{m} sk≡0(modm)
a \bmod b
a m o d b a \bmod b amodb
\gcd(m, n), \operatorname{lcm}(m, n)
gcd ( m , n ) , lcm ( m , n ) \gcd(m, n), \operatorname{lcm}(m, n) gcd(m,n),lcm(m,n)
\mid, \nmid, \shortmid, \nshortmid
∣ , ∤ , ∣ , ∤ \mid, \nmid, \shortmid, \nshortmid ∣,∤,∣,
根号:
\surd, \sqrt{2}, \sqrt[n]{}, \sqrt[3]{\frac{x^3+y^3}{2}}
√
,
2
,
n
,
x
3
+
y
3
2
3
\surd, \sqrt{2}, \sqrt[n]{}, \sqrt[3]{\frac{x^3+y^3}{2}}
√,2,n,32x3+y3
运算符:
+, -, \pm, \mp, \dotplus
+ , − , ± , ∓ , ∔ +, -, \pm, \mp, \dotplus +,−,±,∓,∔
\times, \div, \divideontimes, /, \backslash
× , ÷ , ⋇ , / , \ \times, \div, \divideontimes, /, \backslash ×,÷,⋇,/,\
\cdot, * \ast, \star, \circ, \bullet
⋅ , ∗ ∗ , ⋆ , ∘ , ∙ \cdot, * \ast, \star, \circ, \bullet ⋅,∗∗,⋆,∘,∙
\boxplus, \boxminus, \boxtimes, \boxdot
⊞ , ⊟ , ⊠ , ⊡ \boxplus, \boxminus, \boxtimes, \boxdot ⊞,⊟,⊠,⊡
\oplus, \ominus, \otimes, \oslash, \odot
⊕ , ⊖ , ⊗ , ⊘ , ⊙ \oplus, \ominus, \otimes, \oslash, \odot ⊕,⊖,⊗,⊘,⊙
\circleddash, \circledcirc, \circledast
⊝ , ⊚ , ⊛ \circleddash, \circledcirc, \circledast ⊝,⊚,⊛
\bigoplus, \bigotimes, \bigodot
⨁ , ⨂ , ⨀ \bigoplus, \bigotimes, \bigodot ⨁,⨂,⨀
集合:
\{ \}, \O \empty \emptyset, \varnothing
{ } , \{ \}, {}, KaTeX parse error: Undefined control sequence: \O at position 1: \̲O̲ ̲\empty \emptyse… ∅ \varnothing ∅
\in, \notin \not\in, \ni, \not\ni
∈ , ∉ ∉ , ∋ , ∌ \in, \notin \not\in, \ni, \not\ni ∈,∈/∈,∋,∋
\cap, \Cap, \sqcap, \bigcap
∩ , ⋒ , ⊓ , ⋂ \cap, \Cap, \sqcap, \bigcap ∩,⋒,⊓,⋂
\cup, \Cup, \sqcup, \bigcup, \bigsqcup, \uplus, \biguplus
∪ , ⋓ , ⊔ , ⋃ , ⨆ , ⊎ , ⨄ \cup, \Cup, \sqcup, \bigcup, \bigsqcup, \uplus, \biguplus ∪,⋓,⊔,⋃,⨆,⊎,⨄
\setminus, \smallsetminus, \times
∖ , ∖ , × \setminus, \smallsetminus, \times ∖,∖,×
\subset, \Subset, \sqsubset
⊂ , ⋐ , ⊏ \subset, \Subset, \sqsubset ⊂,⋐,⊏
\supset, \Supset, \sqsupset
⊃ , ⋑ , ⊐ \supset, \Supset, \sqsupset ⊃,⋑,⊐
\subseteq, \nsubseteq, \subsetneq, \varsubsetneq, \sqsubseteq
⊆ , ⊈ , ⊊ , ⊊ , ⊑ \subseteq, \nsubseteq, \subsetneq, \varsubsetneq, \sqsubseteq ⊆,⊈,⊊,,⊑
\supseteq, \nsupseteq, \supsetneq, \varsupsetneq, \sqsupseteq
⊇ , ⊉ , ⊋ , ⊋ , ⊒ \supseteq, \nsupseteq, \supsetneq, \varsupsetneq, \sqsupseteq ⊇,⊉,⊋,,⊒
\subseteqq, \nsubseteqq, \subsetneqq, \varsubsetneqq
⫅ , ⊈ , ⫋ , ⫋ \subseteqq, \nsubseteqq, \subsetneqq, \varsubsetneqq ⫅,,⫋,
\supseteqq, \nsupseteqq, \supsetneqq, \varsupsetneqq
⫆
,
⊉
,
⫌
,
⫌
\supseteqq, \nsupseteqq, \supsetneqq, \varsupsetneqq
⫆,,⫌,
关系符号
=, \ne, \neq, \equiv, \not\equiv
= , ≠ , ≠ , ≡ , ≢ =, \ne, \neq, \equiv, \not\equiv =,=,=,≡,≡
\doteq, \doteqdot, \overset{\underset{\mathrm{def}}{}}{=}, :=
≐ , ≑ , = d e f , : = \doteq, \doteqdot, \overset{\underset{\mathrm{def}}{}}{=}, := ≐,≑,=def,:=
\sim, \nsim, \backsim, \thicksim, \simeq, \backsimeq, \eqsim, \cong, \ncong
∼ , ≁ , ∽ , ∼ , ≃ , ⋍ , ≂ , ≅ , ≆ \sim, \nsim, \backsim, \thicksim, \simeq, \backsimeq, \eqsim, \cong, \ncong ∼,≁,∽,∼,≃,⋍,≂,≅,≆
\approx, \thickapprox, \approxeq, \asymp, \propto, \varpropto
≈ , ≈ , ≊ , ≍ , ∝ , ∝ \approx, \thickapprox, \approxeq, \asymp, \propto, \varpropto ≈,≈,≊,≍,∝,∝
<, \nless, \ll, \not\ll, \lll, \not\lll, \lessdot
< , ≮ , ≪ , ≪̸ , ⋘ , ⋘̸ , ⋖ <, \nless, \ll, \not\ll, \lll, \not\lll, \lessdot <,≮,≪,≪,⋘,⋘,⋖
>, \ngtr, \gg, \not\gg, \ggg, \not\ggg, \gtrdot
> , ≯ , ≫ , ≫̸ , ⋙ , ⋙̸ , ⋗ >, \ngtr, \gg, \not\gg, \ggg, \not\ggg, \gtrdot >,≯,≫,≫,⋙,⋙,⋗
\le, \leq, \lneq, \leqq, \nleq, \nleqq, \lneqq, \lvertneqq
≤ , ≤ , ⪇ , ≦ , ≰ , ≰ , ≨ , ≨ \le, \leq, \lneq, \leqq, \nleq, \nleqq, \lneqq, \lvertneqq ≤,≤,⪇,≦,≰,,≨,
\ge, \geq, \gneq, \geqq, \ngeq, \ngeqq, \gneqq, \gvertneqq
≥ , ≥ , ⪈ , ≧ , ≱ , ≱ , ≩ , ≩ \ge, \geq, \gneq, \geqq, \ngeq, \ngeqq, \gneqq, \gvertneqq ≥,≥,⪈,≧,≱,,≩,
\lessgtr, \lesseqgtr, \lesseqqgtr, \gtrless, \gtreqless, \gtreqqless
≶ , ⋚ , ⪋ , ≷ , ⋛ , ⪌ \lessgtr, \lesseqgtr, \lesseqqgtr, \gtrless, \gtreqless, \gtreqqless ≶,⋚,⪋,≷,⋛,⪌
\leqslant, \nleqslant, \eqslantless
⩽ , ≰ , ⪕ \leqslant, \nleqslant, \eqslantless ⩽,,⪕
\geqslant, \ngeqslant, \eqslantgtr
⩾ , ≱ , ⪖ \geqslant, \ngeqslant, \eqslantgtr ⩾,,⪖
\lesssim, \lnsim, \lessapprox, \lnapprox
≲ , ⋦ , ⪅ , ⪉ \lesssim, \lnsim, \lessapprox, \lnapprox ≲,⋦,⪅,⪉
\gtrsim, \gnsim, \gtrapprox, \gnapprox
≳ , ⋧ , ⪆ , ⪊ \gtrsim, \gnsim, \gtrapprox, \gnapprox ≳,⋧,⪆,⪊
\prec, \nprec, \preceq, \npreceq, \precneqq
≺ , ⊀ , ⪯ , ⋠ , ⪵ \prec, \nprec, \preceq, \npreceq, \precneqq ≺,⊀,⪯,⋠,⪵
\succ, \nsucc, \succeq, \nsucceq, \succneqq
≻ , ⊁ , ⪰ , ⋡ , ⪶ \succ, \nsucc, \succeq, \nsucceq, \succneqq ≻,⊁,⪰,⋡,⪶
\preccurlyeq, \curlyeqprec
≼ , ⋞ \preccurlyeq, \curlyeqprec ≼,⋞
\succcurlyeq, \curlyeqsucc
≽ , ⋟ \succcurlyeq, \curlyeqsucc ≽,⋟
\precsim, \precnsim, \precapprox, \precnapprox
≾ , ⋨ , ⪷ , ⪹ \precsim, \precnsim, \precapprox, \precnapprox ≾,⋨,⪷,⪹
\succsim, \succnsim, \succapprox, \succnapprox
≿ , ⋩ , ⪸ , ⪺ \succsim, \succnsim, \succapprox, \succnapprox ≿,⋩,⪸,⪺
几何符号
\parallel, \nparallel, \shortparallel, \nshortparallel
∥ , ∦ , ∥ , ∦ \parallel, \nparallel, \shortparallel, \nshortparallel ∥,∦,∥,
\perp, \angle, \sphericalangle, \measuredangle, 45^\circ
⊥ , ∠ , ∢ , ∡ , 4 5 ∘ \perp, \angle, \sphericalangle, \measuredangle, 45^\circ ⊥,∠,∢,∡,45∘
\Box, \blacksquare, \diamond, \Diamond \lozenge, \blacklozenge, \bigstar
□ , ■ , ⋄ , ◊ ◊ , ⧫ , ★ \Box, \blacksquare, \diamond, \Diamond \lozenge, \blacklozenge, \bigstar □,■,⋄,◊◊,⧫,★
\bigcirc, \triangle, \bigtriangleup, \bigtriangledown
◯ , △ , △ , ▽ \bigcirc, \triangle, \bigtriangleup, \bigtriangledown ◯,△,△,▽
\vartriangle, \triangledown
△ , ▽ \vartriangle, \triangledown △,▽
\blacktriangle, \blacktriangledown, \blacktriangleleft, \blacktriangleright
▲
,
▼
,
◀
,
▶
\blacktriangle, \blacktriangledown, \blacktriangleleft, \blacktriangleright
▲,▼,◀,▶
逻辑符号
\forall, \exists, \nexists
∀ , ∃ , ∄ \forall, \exists, \nexists ∀,∃,∄
\therefore, \because, \And
∴ , ∵ , & \therefore, \because, \And ∴,∵,&
\or \lor \vee, \curlyvee, \bigvee
$\or ,\lor, ∨ \vee ∨, ⋎ \curlyvee ⋎, ⋁ \bigvee ⋁
\and \land \wedge, \curlywedge, \bigwedge
$\and \land ∧ , ⋏ , ⋀ \wedge, \curlywedge, \bigwedge ∧,⋏,⋀
\bar{q}, \bar{abc}, \overline{q}, \overline{abc},
\lnot \neg, \not\operatorname{R}, \bot, \top
q ˉ , a b c ˉ , q ‾ , a b c ‾ , ¬ ¬ , ̸ R , ⊥ , ⊤ \bar{q}, \bar{abc}, \overline{q}, \overline{abc}, \lnot \neg, \not\operatorname{R}, \bot, \top qˉ,abcˉ,q,abc,¬¬,R,⊥,⊤
\vdash \dashv, \vDash, \Vdash, \models
⊢ ⊣ , ⊨ , ⊩ , ⊨ \vdash \dashv, \vDash, \Vdash, \models ⊢⊣,⊨,⊩,⊨
\Vvdash \nvdash \nVdash \nvDash \nVDash
⊪ ⊬ ⊮ ⊭ ⊯ \Vvdash \nvdash \nVdash \nvDash \nVDash ⊪⊬⊮⊭⊯
\ulcorner \urcorner \llcorner \lrcorner
┌
┐
└
┘
\ulcorner \urcorner \llcorner \lrcorner
┌┐└┘
箭头
\Rrightarrow, \Lleftarrow
⇛ , ⇚ \Rrightarrow, \Lleftarrow ⇛,⇚
\Rightarrow, \nRightarrow, \Longrightarrow \implies
⇒ , ⇏ , ⟹ ⟹ \Rightarrow, \nRightarrow, \Longrightarrow \implies ⇒,⇏,⟹⟹
\Leftarrow, \nLeftarrow, \Longleftarrow
⇐ , ⇍ , ⟸ \Leftarrow, \nLeftarrow, \Longleftarrow ⇐,⇍,⟸
\Leftrightarrow, \nLeftrightarrow, \Longleftrightarrow \iff
⇔ , ⇎ , ⟺ ⟺ \Leftrightarrow, \nLeftrightarrow, \Longleftrightarrow \iff ⇔,⇎,⟺⟺
\Uparrow, \Downarrow, \Updownarrow
⇑ , ⇓ , ⇕ \Uparrow, \Downarrow, \Updownarrow ⇑,⇓,⇕
\rightarrow \to, \nrightarrow, \longrightarrow
→ → , ↛ , ⟶ \rightarrow \to, \nrightarrow, \longrightarrow →→,↛,⟶
\leftarrow \gets, \nleftarrow, \longleftarrow
← ← , ↚ , ⟵ \leftarrow \gets, \nleftarrow, \longleftarrow ←←,↚,⟵
\leftrightarrow, \nleftrightarrow, \longleftrightarrow
↔ , ↮ , ⟷ \leftrightarrow, \nleftrightarrow, \longleftrightarrow ↔,↮,⟷
\uparrow, \downarrow, \updownarrow
↑ , ↓ , ↕ \uparrow, \downarrow, \updownarrow ↑,↓,↕
\nearrow, \swarrow, \nwarrow, \searrow
↗ , ↙ , ↖ , ↘ \nearrow, \swarrow, \nwarrow, \searrow ↗,↙,↖,↘
\mapsto, \longmapsto
↦ , ⟼ \mapsto, \longmapsto ↦,⟼
\rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft \upharpoonright \downharpoonleft \downharpoonright \rightleftharpoons \leftrightharpoons
⇀ ⇁ ↼ ↽ ↿ ↾ ⇃ ⇂ ⇌ ⇋ \rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft \upharpoonright \downharpoonleft \downharpoonright \rightleftharpoons \leftrightharpoons ⇀⇁↼↽↿↾⇃⇂⇌⇋
\curvearrowleft \circlearrowleft \Lsh \upuparrows \rightrightarrows \rightleftarrows \rightarrowtail \looparrowright
↶ ↺ ↰ ⇈ ⇉ ⇄ ↣ ↬ \curvearrowleft \circlearrowleft \Lsh \upuparrows \rightrightarrows \rightleftarrows \rightarrowtail \looparrowright ↶↺↰⇈⇉⇄↣↬
\curvearrowright \circlearrowright \Rsh \downdownarrows \leftleftarrows \leftrightarrows \leftarrowtail \looparrowleft
↷ ↻ ↱ ⇊ ⇇ ⇆ ↢ ↫ \curvearrowright \circlearrowright \Rsh \downdownarrows \leftleftarrows \leftrightarrows \leftarrowtail \looparrowleft ↷↻↱⇊⇇⇆↢↫
\hookrightarrow \hookleftarrow \multimap \leftrightsquigarrow \rightsquigarrow \twoheadrightarrow \twoheadleftarrow
↪
↩
⊸
↭
⇝
↠
↞
\hookrightarrow \hookleftarrow \multimap \leftrightsquigarrow \rightsquigarrow \twoheadrightarrow \twoheadleftarrow
↪↩⊸↭⇝↠↞
特殊符号
省略号:数学公式中常见的省略号有两种,\ldots 表示与文本底线对齐的省略号,\cdots 表示与文本中线对齐的省略号。
\amalg \% \dagger \ddagger \ldots \cdots
⨿ % † ‡ … ⋯ \amalg \% \dagger \ddagger \ldots \cdots ⨿%†‡…⋯
\smile \frown \wr \triangleleft \triangleright
⌣ ⌢ ≀ ◃ ▹ \smile \frown \wr \triangleleft \triangleright ⌣⌢≀◃▹
\diamondsuit, \heartsuit, \clubsuit, \spadesuit, \Game, \flat, \natural, \sharp
♢
,
♡
,
♣
,
♠
,
⅁
,
♭
,
♮
,
♯
\diamondsuit, \heartsuit, \clubsuit, \spadesuit, \Game, \flat, \natural, \sharp
♢,♡,♣,♠,⅁,♭,♮,♯
未分类
\diagup \diagdown \centerdot \ltimes \rtimes \leftthreetimes \rightthreetimes
╱ ╲ ⋅ ⋉ ⋊ ⋋ ⋌ \diagup \diagdown \centerdot \ltimes \rtimes \leftthreetimes \rightthreetimes ╱╲⋅⋉⋊⋋⋌
\eqcirc \circeq \triangleq \bumpeq \Bumpeq \doteqdot \risingdotseq \fallingdotseq
≖ ≗ ≜ ≏ ≎ ≑ ≓ ≒ \eqcirc \circeq \triangleq \bumpeq \Bumpeq \doteqdot \risingdotseq \fallingdotseq ≖≗≜≏≎≑≓≒
\intercal \barwedge \veebar \doublebarwedge \between \pitchfork
⊺ ⊼ ⊻ ⩞ ≬ ⋔ \intercal \barwedge \veebar \doublebarwedge \between \pitchfork ⊺⊼⊻⩞≬⋔
\vartriangleleft \ntriangleleft \vartriangleright \ntriangleright
⊲ ⋪ ⊳ ⋫ \vartriangleleft \ntriangleleft \vartriangleright \ntriangleright ⊲⋪⊳⋫
\trianglelefteq \ntrianglelefteq \trianglerighteq \ntrianglerighteq
⊴ ⋬ ⊵ ⋭ \trianglelefteq \ntrianglelefteq \trianglerighteq \ntrianglerighteq ⊴⋬⊵⋭
2.上下标,积分
功能|语法|效果
^ 表示上标, _ 表示下标。如果上下标的内容多于一个字符,需要用 {} 将这些内容括成一个整体。上下标可以嵌套,也可以同时使用。
前置上下标
{}_1^2\!X_3^4
1
2
X
3
4
{}_1^2\!X_3^4
12X34
导数(html)
x'
x
′
x'
x′
导数(png)
x^\prime
x
′
x^\prime
x′
导数点
\dot{x}
x ˙ \dot{x} x˙
\ddot{y}
y
¨
\ddot{y}
y¨
向量
\vec{c}(只有一个字母)
c ⃗ \vec{c} c
\overleftarrow{a b}
a b ← \overleftarrow{a b} ab
\overrightarrow{c d}
c d → \overrightarrow{c d} cd
\overleftrightarrow{a b}
a b ↔ \overleftrightarrow{a b} ab
\widehat{e f g}
e f g ^ \widehat{e f g} efg
上弧
(注: 正确应该用 \overarc,但在这里行不通。要用建议的语法作为解决办法。)(使用 \ overarc 时需要引入 {arcs} 包。)
\overset{\frown} {AB}
A
B
⌢
\overset{\frown} {AB}
AB⌢
上划线
\overline{h i j}
h
i
j
‾
\overline{h i j}
hij
下划线
\underline{k l m}
k l m ‾ \underline{k l m} klm
上括号
\overbrace{1+2+\cdots+100}
1 + 2 + ⋯ + 100 ⏞ \overbrace{1+2+\cdots+100} 1+2+⋯+100
\begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix}
5050 1 + 2 + ⋯ + 100 ⏞ \begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix} 50501+2+⋯+100
下括号
\underbrace{a+b+\cdots+z}
a + b + ⋯ + z ⏟ \underbrace{a+b+\cdots+z} a+b+⋯+z
\begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix}
a + b + ⋯ + z ⏟ 26 \begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix} a+b+⋯+z26
求和(累加)
\sum_{k=1}^N k^2
∑ k = 1 N k 2 \sum_{k=1}^N k^2 ∑k=1Nk2
\begin{matrix} \sum_{k=1}^N k^2 \end{matrix}
∑ k = 1 N k 2 \begin{matrix} \sum_{k=1}^N k^2 \end{matrix} ∑k=1Nk2
求积(累积)
\prod_{i=1}^N x_i
∏ i = 1 N x i \prod_{i=1}^N x_i ∏i=1Nxi
\begin{matrix} \prod_{i=1}^N x_i \end{matrix}
∏ i = 1 N x i \begin{matrix} \prod_{i=1}^N x_i \end{matrix} ∏i=1Nxi
上积
\coprod_{i=1}^N x_i
∐ i = 1 N x i \coprod_{i=1}^N x_i ∐i=1Nxi
\begin{matrix} \coprod_{i=1}^N x_i \end{matrix}
∐ i = 1 N x i \begin{matrix} \coprod_{i=1}^N x_i \end{matrix} ∐i=1Nxi
极限
\lim_{n \to \infty}x_n
lim n → ∞ x n \lim_{n \to \infty}x_n limn→∞xn
\begin{matrix} \lim_{n \to \infty}x_n \end{matrix}
lim n → ∞ x n \begin{matrix} \lim_{n \to \infty}x_n \end{matrix} limn→∞xn (为什么显示和上个没区别???)
积分
\int_{-N}^{N} e^x\, {\rm d}x
∫
−
N
N
e
x
d
x
\int_{-N}^{N} e^x\, {\rm d}x
∫−NNexdx
本例中 , 和 {\rm d} 部分可省略,但建议加入,能使式子更美观。{\rm d}可以用\mathrm{d}等价替换。
\begin{matrix} \int_{-N}^{N} e^x\, \mathrm{d}x \end{matrix}(矩阵中积分符号变小)
∫ − N N e x d x \begin{matrix} \int_{-N}^{N} e^x\, \mathrm{d}x \end{matrix} ∫−NNexdx
双重积分
\iint_{D}^{W} \, \mathrm{d}x\,\mathrm{d}y
∬
D
W
d
x
d
y
\iint_{D}^{W} \, \mathrm{d}x\,\mathrm{d}y
∬DWdxdy
三重积分
\iiint_{E}^{V} \, \mathrm{d}x\,\mathrm{d}y\,\mathrm{d}z
∭ E V d x d y d z \iiint_{E}^{V} \, \mathrm{d}x\,\mathrm{d}y\,\mathrm{d}z ∭EVdxdydz
闭合的曲线、曲面积分
\oint_{C} x^3\, \mathrm{d}x + 4y^2\, \mathrm{d}y
∮
C
x
3
d
x
+
4
y
2
d
y
\oint_{C} x^3\, \mathrm{d}x + 4y^2\, \mathrm{d}y
∮Cx3dx+4y2dy
交集
\bigcap_1^{n} p
⋂ 1 n p \bigcap_1^{n} p ⋂1np
并集
\bigcup_1^{k} p
⋃ 1 k p \bigcup_1^{k} p ⋃1kp
3.分数
通常使用 \frac {分子} {分母} 命令产生一个分数,分数可嵌套。
便捷情况可直接输入 \frac ab 来快速生成一个
a
b
\frac ab
ba。
如果分式很复杂,亦可使用 分子 \over 分母 命令,此时分数仅有一层。
功能|语法|效果
分数
\frac{2}{4}=0.5
2
4
=
0.5
\frac{2}{4}=0.5
42=0.5
小型分数
\tfrac{2}{4} = 0.5
2 4 = 0.5 \tfrac{2}{4} = 0.5 42=0.5
连分式(大型嵌套分式)
\cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a
2
c
+
2
d
+
2
4
=
a
\cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a
c+d+4222=a
大型不嵌套分式
\dfrac{2}{4} = 0.5 \qquad \dfrac{2}{c + \dfrac{2}{d + \dfrac{2}{4}}} = a
2 4 = 0.5 2 c + 2 d + 2 4 = a \dfrac{2}{4} = 0.5 \qquad \dfrac{2}{c + \dfrac{2}{d + \dfrac{2}{4}}} = a 42=0.5c+d+4222=a
二项式系数
\dbinom{n}{r}=\binom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}
(
n
r
)
=
(
n
n
−
r
)
=
C
n
r
=
C
n
n
−
r
\dbinom{n}{r}=\binom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}
(rn)=(n−rn)=Cnr=Cnn−r
小型二项式系数
\tbinom{n}{r}=\tbinom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}
(
n
r
)
=
(
n
n
−
r
)
=
C
n
r
=
C
n
n
−
r
\tbinom{n}{r}=\tbinom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}
(rn)=(n−rn)=Cnr=Cnn−r
大型二项式系数
\binom{n}{r}=\dbinom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r}
( n r ) = ( n n − r ) = C n r = C n n − r \binom{n}{r}=\dbinom{n}{n-r}=\mathrm{C}_n^r=\mathrm{C}_n^{n-r} (rn)=(n−rn)=Cnr=Cnn−r
在以e为底的指数函数、极限和积分中尽量不要使用 \frac 符号:它会使整段函数看起来很怪,而且可能产生歧义。也正是因此它在专业数学排版中几乎从不出现。
横着写这些分式,中间使用斜线间隔 / (用斜线代替分数线)。
\begin{array}{cc}
\mathrm{Bad} & \mathrm{Better} \\
\hline \\
e^{i\frac{\pi}2} \quad e^{\frac{i\pi}2}& e^{i\pi/2} \\
\int_{-\frac\pi2}^\frac\pi2 \sin x\,dx & \int_{-\pi/2}^{\pi/2}\sin x\,dx \\
\end{array}
B a d B e t t e r e i π 2 e i π 2 e i π / 2 ∫ − π 2 π 2 sin x d x ∫ − π / 2 π / 2 sin x d x \begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \\ \hline \\ e^{i\frac{\pi}2} \quad e^{\frac{i\pi}2}& e^{i\pi/2} \\ \int_{-\frac\pi2}^\frac\pi2 \sin x\,dx & \int_{-\pi/2}^{\pi/2}\sin x\,dx \\ \end{array} Badei2πe2iπ∫−2π2πsinxdxBettereiπ/2∫−π/2π/2sinxdx
4.矩阵、条件表达式、方程组
语法:
\begin{类型}
公式内容
\end{类型}
类型可以是:矩阵 matrix pmatrix bmatrix Bmatrix vmatrix Vmatrix、条件表达式 cases、多行对齐方程式 aligned、数组 array。
在公式内容中:在每一行中插入 & 来指定需要对齐的内容,在每行结尾处使用 \ 换行。
无框矩阵
在开头使用 begin{matrix},在结尾使用 end{matrix},在中间插入矩阵元素,每个元素之间插入 & ,并在每行结尾处使用 \ 。
\begin{matrix}
x & y \\
z & v
\end{matrix}
x y z v \begin{matrix} x & y \\ z & v \end{matrix} xzyv
有框矩阵
在开头将 matrix 替换为 pmatrix bmatrix Bmatrix vmatrix Vmatrix 。
\begin{vmatrix}
x & y \\
z & v
\end{vmatrix}
∣ x y z v ∣ \begin{vmatrix} x & y \\ z & v \end{vmatrix} ∣∣∣∣xzyv∣∣∣∣
\begin{Vmatrix}
x & y \\
z & v
\end{Vmatrix}
∥
x
y
z
v
∥
\begin{Vmatrix} x & y \\ z & v \end{Vmatrix}
∥∥∥∥xzyv∥∥∥∥
使用 \cdots ⋯\cdots⋯ , \ddots ⋱\ddots⋱ , \vdots ⋮\vdots⋮ 来输入省略符号。
\begin{bmatrix}
0 & \cdots & 0 \\
\vdots & \ddots & \vdots \\
0 & \cdots & 0
\end{bmatrix}
[ 0 ⋯ 0 ⋮ ⋱ ⋮ 0 ⋯ 0 ] \begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0 \end{bmatrix} ⎣⎢⎡0⋮0⋯⋱⋯0⋮0⎦⎥⎤
\begin{Bmatrix}
x & y \\
z & v
\end{Bmatrix}
{ x y z v } \begin{Bmatrix} x & y \\ z & v \end{Bmatrix} {xzyv}
\begin{pmatrix}
x & y \\
z & v
\end{pmatrix}
( x y z v ) \begin{pmatrix} x & y \\ z & v \end{pmatrix} (xzyv)
条件表达式
f(n) =
\begin{cases}
n/2, & \text{if }n\text{ is even} \\
3n+1, & \text{if }n\text{ is odd}
\end{cases}
f
(
n
)
=
{
n
/
2
,
if
n
is even
3
n
+
1
,
if
n
is odd
f(n) = \begin{cases} n/2, & \text{if }n\text{ is even} \\ 3n+1, & \text{if }n\text{ is odd} \end{cases}
f(n)={n/2,3n+1,if n is evenif n is odd
多行等式、同余式
人们经常想要一列整齐且居中的方程式序列。使用 \begin{aligned}…\end{aligned}。
\begin{aligned}
f(x) & = (m+n)^2 \\
& = m^2+2mn+n^2 \\
\end{aligned}
f ( x ) = ( m + n ) 2 = m 2 + 2 m n + n 2 \begin{aligned} f(x) & = (m+n)^2 \\ & = m^2+2mn+n^2 \\ \end{aligned} f(x)=(m+n)2=m2+2mn+n2
\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}
3 6 n + 3 + 4 6 n + 3 ≡ ( 3 3 ) 2 n + 1 + ( 4 3 ) 2 n + 1 ≡ 2 7 2 n + 1 + 6 4 2 n + 1 ≡ 2 7 2 n + 1 + ( − 27 ) 2 n + 1 ≡ 2 7 2 n + 1 − 2 7 2 n + 1 ≡ 0 ( m o d 91 ) \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} 36n+3+46n+3≡(33)2n+1+(43)2n+1≡272n+1+642n+1≡272n+1+(−27)2n+1≡272n+1−272n+1≡0(mod91)
\begin{alignedat}{3}
f(x) & = (m-n)^2 \\
f(x) & = (-m+n)^2 \\
& = m^2-2mn+n^2 \\
\end{alignedat}
f
(
x
)
=
(
m
−
n
)
2
f
(
x
)
=
(
−
m
+
n
)
2
=
m
2
−
2
m
n
+
n
2
\begin{alignedat}{3} f(x) & = (m-n)^2 \\ f(x) & = (-m+n)^2 \\ & = m^2-2mn+n^2 \\ \end{alignedat}
f(x)f(x)=(m−n)2=(−m+n)2=m2−2mn+n2
方程组
\begin{cases}
3x + 5y + z \\
7x - 2y + 4z \\
-6x + 3y + 2z
\end{cases}
{
3
x
+
5
y
+
z
7
x
−
2
y
+
4
z
−
6
x
+
3
y
+
2
z
\begin{cases} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \end{cases}
⎩⎪⎨⎪⎧3x+5y+z7x−2y+4z−6x+3y+2z
or
\left\{\begin{aligned}
3x + 5y + z \\
7x - 2y + 4z \\
-6x + 3y + 2z
\end{aligned}\right.
{ 3 x + 5 y + z 7 x − 2 y + 4 z − 6 x + 3 y + 2 z \left\{\begin{aligned} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \end{aligned}\right. ⎩⎪⎨⎪⎧3x+5y+z7x−2y+4z−6x+3y+2z
5.数组、表格
通常,一个格式化后的表格比单纯的文字或排版后的文字更具有可读性。数组和表格均以 \begin{array} 开头,并在其后定义列数及每一列的文本对齐属性,c l r 分别代表居中、左对齐及右对齐。若需要插入垂直分割线,在定义式中插入 | ,若要插入水平分割线,在下一行输入前插入 \hline 。与矩阵相似,每行元素间均须要插入 & ,每行元素以 \ 结尾,最后以 \end{array} 结束数组。
\begin{array}{c|lcr}
n & \text{左对齐} & \text{居中对齐} & \text{右对齐} \\
\hline
1 & 0.24 & 1 & 125 \\
2 & -1 & 189 & -8 \\
3 & -20 & 2000 & 1+10i
\end{array}
n 左对齐 居中对齐 右对齐 1 0.24 1 125 2 − 1 189 − 8 3 − 20 2000 1 + 10 i \begin{array}{c|lcr} n & \text{左对齐} & \text{居中对齐} & \text{右对齐} \\ \hline 1 & 0.24 & 1 & 125 \\ 2 & -1 & 189 & -8 \\ 3 & -20 & 2000 & 1+10i \end{array} n123左对齐0.24−1−20居中对齐11892000右对齐125−81+10i
\begin{array}{lcl}
z & = & a \\
f(x,y,z) & = & x + y + z
\end{array}
z = a f ( x , y , z ) = x + y + z \begin{array}{lcl} z & = & a \\ f(x,y,z) & = & x + y + z \end{array} zf(x,y,z)==ax+y+z
\begin{array}{lcr}
z & = & a \\
f(x,y,z) & = & x + y + z
\end{array}
z = a f ( x , y , z ) = x + y + z \begin{array}{lcr} z & = & a \\ f(x,y,z) & = & x + y + z \end{array} zf(x,y,z)==ax+y+z