文章目录
1 数学公式的插入
将数学公式写在 $ $ 之间,代表的是插入行内数学公式(通常称为行内模式)。
将数学公式写在 $$ $$ 之间,会使公式独立成一行并强制居中(通常称为独立模式)。
空格用\quad表示, 并使用如下格式:
LaTex句法
句法对应数学符号
2 声调 / 变音符号
$\dot{a} \quad \ddot{a} \quad \acute{a} \quad \grave{a}$
a ˙ a ¨ a ˊ a ˋ \dot{a} \quad \ddot{a} \quad \acute{a} \quad \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
3 标准函数
$\exp_a b=a^b \quad \exp b=e^b \quad 10^m$
exp a b = a b exp b = e b 1 0 m \exp_a b=a^b \quad \exp b=e^b \quad 10^m expab=abexpb=eb10m
$\sin a \cos b \tan c \sec d \csc e \cot f$
sin a cos b tan c sec d csc e cot f \sin a \cos b \tan c \sec d \csc e \cot f sinacosbtancsecdcscecotf
$\arcsin a \arccos b \arctan c$
arcsin a arccos b arctan c \arcsin a \arccos b \arctan c arcsinaarccosbarctanc
$\sinh a \cosh b \tanh c \coth d$
sinh a cosh b tanh c coth d \sinh a \cosh b \tanh c \coth d sinhacoshbtanhccothd
$\sh a \ch b \th c$
sh a ch b th c \sh a \ch b \th c shachbthc
$\operatorname{argsh} a \operatorname{argch} b \operatorname{argth} c$
argsh a argch b argth c \operatorname{argsh} a \operatorname{argch} b \operatorname{argth} c argshaargchbargthc
PS:\operatorname{} 貌似可以将任何字符转换成标准函数的形式。
$\left\vert a\right\vert \min(x,y) \max(x,y)$
∣ a ∣ min ( x , y ) max ( x , y ) \left\vert a\right\vert \min(x,y) \max(x,y) ∣a∣min(x,y)max(x,y)
4 界限
$\min x \max y \inf s \sup t$
min x max y inf s sup t \min x \max y \inf s \sup t minxmaxyinfssupt
$\lim u \liminf v \limsup w$
lim u lim inf v lim sup w \lim u \liminf v \limsup w limuliminfvlimsupw
``` dim p deg q det m ker ϕ \dim p \deg q \det m \ker\phi dimpdegqdetmkerϕ``
dim p deg q det m ker ϕ \dim p \deg q \det m \ker\phi dimpdegqdetmkerϕ
5 投射
PS:感觉这翻译很奇怪,应该是映射吧。
$\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 Prjhoml∥z∥argz
PS:个人认为 \lVert、\rVert 与 \Vert 和 | 并没有什么区别。
6 微分及导数
$dt \mathrm{d}t \partial t \nabla\psi$
d t d t ∂ t ∇ ψ dt \mathrm{d}t \partial t \nabla\psi dtdt∂t∇ψ
$\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¨
7 类字母符号及常数
$\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ℓ℧℘ℜⓈ
8 模算数
$a\equiv1\pmod{m}$
a ≡ 1 ( m o d m ) a\equiv1\pmod{m} a≡1(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 ∣∤∣
PS:\mid 可以用 | 代替。(管理员注:\mid 实际上差不多是 \mathrel{|},两侧的 spacing 有区别的)
$a\%b$
a % b a\%b a%b
(管理员注:不建议在公式中使用 % 作为取模,一般仅作百分号使用)
9 根号
$\surd \sqrt{2} \sqrt[n]{} \sqrt[n]{x}$
√ 2 n x n \surd \sqrt{2} \sqrt[n]{} \sqrt[n]{x} √2nnx
10 运算符
$+ - \pm \mp \dotplus$
+ − ± ∓ ∔ + - \pm \mp \dotplus +−±∓∔
$\times \div \divideontimes / \backslash$
× ÷ ⋇ / \ \times \div \divideontimes / \backslash ×÷⋇/\
$\cdot * \star \circ \bullet$
⋅ ∗ ⋆ ∘ ∙ \cdot * \star \circ \bullet ⋅∗⋆∘∙
PS:* 可以用 \ast 代替。
$\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 ⨁⨂⨀
11 集合
$\{ \} \emptyset \varnothing$
{ } ∅ ∅ \{ \} \emptyset \varnothing {}∅∅
$\in \notin \not\in \ni \not\ni$
∈ ∉ ∉ ∋ ∌ \in \notin \not\in \ni \not\ni ∈∈/∈∋∋
PS:\not 是在下一个字符上画斜杠。
$\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 ⫆⫌
12 关系符号
$= \ne \neq \equiv \not\equiv$
= ≠ ≠ ≡ ≢ = \ne \neq \equiv \not\equiv ===≡≡
PS:表示并没有看出来 \ne 和 \neq 的区别……(管理员注:因为是一样的)
$\doteq \doteqdot \overset{\underset{def}{}}{=} :=$
≐ ≑ = d e f : = \doteq \doteqdot \overset{\underset{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 ≿⋩⪸⪺
13 几何符号
$\parallel \nparallel \shortparallel \nshortparallel$
∥ ∦ ∥ ∦ \parallel \nparallel \shortparallel \nshortparallel ∥∦∥
ps:\parallel应该和|是一样的。
$\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 ◯△△▽
ps:并没有看出\triangle和\bigtriangleup有什么区别。
$\vartriangle \triangledown \triangleleft \triangleright$
△ ▽ ◃ ▹ \vartriangle \triangledown \triangleleft \triangleright △▽◃▹
$\blacktriangle \blacktriangledown \blacktriangleleft \blacktriangleright$
▲ ▼ ◀ ▶ \blacktriangle \blacktriangledown \blacktriangleleft \blacktriangleright ▲▼◀▶
14 逻辑符号
$\forall \exists \nexists$
∀ ∃ ∄ \forall \exists \nexists ∀∃∄
$\therefore \because \And$
∴ ∵ & \therefore \because \And ∴∵&
ps:\And也可用&,至少我没看出来这两个有什么差别。
$\lor \vee \curlyvee \bigvee$
∨ ∨ ⋎ ⋁ \lor \vee \curlyvee \bigvee ∨∨⋎⋁
$\land \wedge \curlywedge \bigwedge$
∧ ∧ ⋏ ⋀ \land \wedge \curlywedge \bigwedge ∧∧⋏⋀
$\bar{q} \bar{abc} \overline{q} \overline{abc}$
q ˉ a b c ˉ q ‾ a b c ‾ \bar{q} \bar{abc} \overline{q} \overline{abc} qˉabcˉqabc
$\lnot \neg \bot \top$
¬ ¬ ⊥ ⊤ \lnot \neg \bot \top ¬¬⊥⊤
$\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 ┌┐└┘
15 箭头
$\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 ⇑⇓⇕
$\leftarrow \rightarrow \nleftarrow \nrightarrow \leftrightarrow \nleftrightarrow \longleftarrow \longrightarrow \longleftrightarrow$
← → ↚ ↛ ↔ ↮ ⟵ ⟶ ⟷ \leftarrow \rightarrow \nleftarrow \nrightarrow \leftrightarrow \nleftrightarrow \longleftarrow \longrightarrow \longleftrightarrow ←→↚↛↔↮⟵⟶⟷
ps:\leftarrow可用\gets代替,\rightarrow可用\to代替。
$\uparrow \downarrow \updownarrow \nearrow \searrow \nwarrow \swarrow$
↑ ↓ ↕ ↗ ↘ ↖ ↙ \uparrow \downarrow \updownarrow \nearrow \searrow \nwarrow \swarrow ↑↓↕↗↘↖↙
$\mapsto \longmapsto$
↦ ⟼ \mapsto \longmapsto ↦⟼
$\rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft \upharpoonright \downharpoonleft \downharpoonright \leftrightharpoons \rightleftharpoons$
⇀ ⇁ ↼ ↽ ↿ ↾ ⇃ ⇂ ⇋ ⇌ \rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft \upharpoonright \downharpoonleft \downharpoonright \leftrightharpoons \rightleftharpoons ⇀⇁↼↽↿↾⇃⇂⇋⇌
$\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 ↪↩⊸↭⇝↠↞
$\xleftarrow{left} \xrightarrow{right} \xLeftarrow{Left} \xRightarrow{Right} \xleftrightarrow{left\& right} \xLeftrightarrow{Left\& Right}$
← l e f t → r i g h t ⇐ L e f t ⇒ R i g h t ↔ l e f t & r i g h t ⇔ L e f t & R i g h t \xleftarrow{left} \xrightarrow{right} \xLeftarrow{Left} \xRightarrow{Right} \xleftrightarrow{left\& right} \xLeftrightarrow{Left\& Right} leftrightLeftRightleft&right Left&Right
16 特殊符号
$\amalg \% \dagger \ddagger \ldots \cdots$
⨿ % † ‡ … ⋯ \amalg \% \dagger \ddagger \ldots \cdots ⨿%†‡…⋯
ps:\dots和\ldots貌似是一样的。
$\smile \frown \wr$
⌣ ⌢ ≀ \smile \frown \wr ⌣⌢≀
$\diamondsuit \heartsuit \clubsuit \spadesuit \Game \flat \natural \sharp$
♢ ♡ ♣ ♠ ⅁ ♭ ♮ ♯ \diamondsuit \heartsuit \clubsuit \spadesuit \Game \flat \natural \sharp ♢♡♣♠⅁♭♮♯
以下是WikiWiki中没有分类的符号,我暂且将其归入特殊符号中
$\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 ⊴⋬⊵⋭
$\LaTeX$
LaTeX \LaTeX LATEX
ps:应评论要求加上,其实介于阅读体验还是少用些。
17 上标、下标及积分等
17.1 上标
$a^2$
a 2 a^2 a2
17.2 下标
$a_2$
a 2 a_2 a2
17.3 组合
$a^{2+2} a_{i,j}$
a 2 + 2 a i , j a^{2+2} a_{i,j} a2+2ai,j
17.4 结合上下标
$a^2_2$
a 2 2 a^2_2 a22
17.5 前置上下标
${}^2_1\!X^3_4$
1 2 X 4 3 {}^2_1\!X^3_4 12X43
ps:!的作用在下面空格一栏有讲述。
17.6 导数
(1)偏导符号:\partial x
$\frac{\partial f}{\partial x}$ # 一阶
$\frac{\partial ^{n} f}{\partial x^{n}}$ # n阶
∂
f
∂
x
\frac{\partial f}{\partial x}
∂x∂f # 一阶
∂
n
f
∂
x
n
\frac{\partial ^{n} f}{\partial x^{n}}
∂xn∂nf # n阶
(2)求导符号:\mathrm{d} x
$\frac{\mathrm{d} y }{\mathrm{d} x}$ # 一阶
$\frac{\mathrm{d}^{n} y }{\mathrm{d} x^{n}}$ # n阶
d
y
d
x
\frac{\mathrm{d} y }{\mathrm{d} x}
dxdy # 一阶
d
n
y
d
x
n
\frac{\mathrm{d}^{n} y }{\mathrm{d} x^{n}}
dxndny # n阶
(3)撇形式的求导符号:x^{'}
$ \frac{ y^{'} }{ x^{'} } $
y
′
x
′
\frac{ y^{'} }{ x^{'}}
x′y′
(4)点形式的求导符号:\dot x 和 \ddot y
$ \frac{ \dot y }{ \dot x } $ # 一个点
$ \frac{ \ddot y }{ \ddot x } $ # 两个点
y
˙
x
˙
\frac{ \dot y }{ \dot x }
x˙y˙ # 一个点
y
¨
x
¨
\frac{ \ddot y }{ \ddot x }
x¨y¨ # 两个点
5)全微分算子:\nabla f
$\nabla f$
∇ f \nabla f ∇f
17.7 导数点
$\dot{x} \ddot{x}$
x ˙ x ¨ \dot{x} \ddot{x} x˙x¨
17.8 向量
$\vec{x} \overleftarrow{AB} \overrightarrow{AB} \widehat{AB}$
x ⃗ A B ← A B → A B ^ \vec{x} \overleftarrow{AB} \overrightarrow{AB} \widehat{AB} xABABAB
17.9 上弧
$\overset{\frown}{AB}$
A B ⌢ \overset{\frown}{AB} AB⌢
ps:正确的语法应该是\overarc,但因为没有引入amsmath宏包,所以无法使用,只能用这个替代下。
17.10 上划线
$\overline{ABC}$
A B C ‾ \overline{ABC} ABC
17.11 下划线
$\underline{ABC}$
A B C ‾ \underline{ABC} ABC
17.12 上括号
$\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
ps:'\'是换行的意思。
17.13 下括号
$\underbrace{1+2+\cdots+100}$
1 + 2 + ⋯ + 100 ⏟ \underbrace{1+2+\cdots+100} 1+2+⋯+100
$\begin{matrix}\underbrace{1+2+\cdots+100}\\5050\end{matrix}$
1 + 2 + ⋯ + 100 ⏟ 5050 \begin{matrix}\underbrace{1+2+\cdots+100}\\5050\end{matrix} 1+2+⋯+1005050
17.14 求和
$\sum_{i=1}^na_i \sum\limits_{i=1}^na_i$
∑ i = 1 n a i ∑ i = 1 n a i \sum_{i=1}^na_i \sum\limits_{i=1}^na_i ∑i=1naii=1∑nai
17.15 求积
$\prod_{i=1}^na_i \prod\limits_{i=1}^na_i$
∏ i = 1 n a i ∏ i = 1 n a i \prod_{i=1}^na_i \prod\limits_{i=1}^na_i ∏i=1naii=1∏nai
17.16 上积
$\coprod_{i=1}^na_i \coprod\limits_{i=1}^na_i$
∐ i = 1 n a i ∐ i = 1 n a i \coprod_{i=1}^na_i \coprod\limits_{i=1}^na_i ∐i=1naii=1∐nai
17.17 极限
$\lim_{n\to\infty}x_n \lim\limits_{n\to\infty}x_n$
lim n → ∞ x n lim n → ∞ x n \lim_{n\to\infty}x_n \lim\limits_{n\to\infty}x_n limn→∞xnn→∞limxn
17.18 积分
$\int_{-N}^{N}e^x\,dx$
∫ − N N e x d x \int_{-N}^{N}e^x\,dx ∫−NNexdx
ps:,的作用在下面空格一栏有讲。
17.19 双重积分
$\iint_M^Ndx\,dy$
∬ M N d x d y \iint_M^Ndx\,dy ∬MNdxdy
17.20 三重积分
$\iiint_M^Ndx\,dy\,dz$
∭ M N d x d y d z \iiint_M^Ndx\,dy\,dz ∭MNdxdydz
17.21 闭合的曲线、曲面积分
$\oint_Cx^3\,dx+4y^2\,dy$
∮ C x 3 d x + 4 y 2 d y \oint_Cx^3\,dx+4y^2\,dy ∮Cx3dx+4y2dy
17.22 交集
$\bigcap_1^np \bigcap\limits_1^np$
⋂ 1 n p ⋂ 1 n p \bigcap_1^np \bigcap\limits_1^np ⋂1np1⋂np
17.23 并集
$\bigcup_1^np \bigcup\limits_1^np$
⋃ 1 n p ⋃ 1 n p \bigcup_1^np \bigcup\limits_1^np ⋃1np1⋃np
18 分数、矩阵等
18.1 分数
$\frac{1}{2}=0.5$
1 2 = 0.5 \frac{1}{2}=0.5 21=0.5
18.2 小型分数
$\tfrac{1}{2}=0.5$
1 2 = 0.5 \tfrac{1}{2}=0.5 21=0.5
ps:并不清楚为什么洛谷的LaTeX里普通分数和小型分数一样大……
18.3 大型分数
$\dfrac{1}{2}=0.5 \dfrac{1}{x+\dfrac{3}{y+\dfrac{1}{5}}}$
1 2 = 0.5 1 x + 3 y + 1 5 \dfrac{1}{2}=0.5 \dfrac{1}{x+\dfrac{3}{y+\dfrac{1}{5}}} 21=0.5x+y+5131
18.4 二项式系数
$\dbinom{n}{m}=\dbinom{n}{n-m}=C_n^m=C_n^{n-m}$
( n m ) = ( n n − m ) = C n m = C n n − m \dbinom{n}{m}=\dbinom{n}{n-m}=C_n^m=C_n^{n-m} (mn)=(n−mn)=Cnm=Cnn−m
18.5 小型二项式系数
$\tbinom{n}{m}=\tbinom{n}{n-m}=C_n^m=C_n^{n-m}$
( n m ) = ( n n − m ) = C n m = C n n − m \tbinom{n}{m}=\tbinom{n}{n-m}=C_n^m=C_n^{n-m} (mn)=(n−mn)=Cnm=Cnn−m
$\binom{n}{m}=\binom{n}{n-m}=C_n^m=C_n^{n-m}$
( n m ) = ( n n − m ) = C n m = C n n − m \binom{n}{m}=\binom{n}{n-m}=C_n^m=C_n^{n-m} (mn)=(n−mn)=Cnm=Cnn−m
18.6 矩阵
$\begin{matrix}a&b\\c&d\end{matrix}$
a b c d \begin{matrix}a&b\\c&d\end{matrix} acbdps:&是使上下行对齐。
$\begin{vmatrix}a&b\\c&d\end{vmatrix}$
∣ a b c d ∣ \begin{vmatrix}a&b\\c&d\end{vmatrix} ∣∣∣∣acbd∣∣∣∣
$\begin{Vmatrix}a&b\\c&d\end{Vmatrix}$
∥ a b c d ∥ \begin{Vmatrix}a&b\\c&d\end{Vmatrix} ∥∥∥∥acbd∥∥∥∥
$\begin{bmatrix}a&\cdots&b\\\vdots&\ddots&\vdots\\c&\cdots&d\end{bmatrix}$
[ a ⋯ b ⋮ ⋱ ⋮ c ⋯ d ] \begin{bmatrix}a&\cdots&b\\\vdots&\ddots&\vdots\\c&\cdots&d\end{bmatrix} ⎣⎢⎡a⋮c⋯⋱⋯b⋮d⎦⎥⎤ps:\vdots是竖着3个点,\ddots是斜着3个点。
$\begin{Bmatrix}a&c\\b&d\end{Bmatrix}$
{ a c b d } \begin{Bmatrix}a&c\\b&d\end{Bmatrix} {abcd}
$\begin{pmatrix}a&c\\b&d\end{pmatrix}$
( a c b d ) \begin{pmatrix}a&c\\b&d\end{pmatrix} (abcd)
18.7 矩阵嵌套
$\begin{vmatrix} \begin{Bmatrix}A & \\ c & d \end{Bmatrix} & x\\ \dfrac{1}{2} & \begin{matrix} 1 & 2 \\ 3 & 4 \end{matrix} \end{vmatrix}$
∣ { A c d } x 1 2 1 2 3 4 ∣ \begin{vmatrix} \begin{Bmatrix}A & \\ c & d \end{Bmatrix} & x\\ \dfrac{1}{2} & \begin{matrix} 1 & 2 \\ 3 & 4 \end{matrix} \end{vmatrix} ∣∣∣∣∣∣∣∣{Acd}21x1324∣∣∣∣∣∣∣∣
18.8 条件定义(如分段函数)
$f(x)=\begin{cases}x-1&x\leqslant3\\x^2+3x-1&x>3\end{cases}$
f ( x ) = { x − 1 x ⩽ 3 x 2 + 3 x − 1 x > 3 f(x)=\begin{cases}x-1&x\leqslant3\\x^2+3x-1&x>3\end{cases} f(x)={x−1x2+3x−1x⩽3x>3
18.9 方程组
$\begin{cases}2x+9y-5z=10\\4x+20y+z=24\\x-\dfrac{1}{2}y+3z=8\end{cases}$
{ 2 x + 9 y − 5 z = 10 4 x + 20 y + z = 24 x − 1 2 y + 3 z = 8 \begin{cases}2x+9y-5z=10\\4x+20y+z=24\\x-\dfrac{1}{2}y+3z=8\end{cases} ⎩⎪⎪⎨⎪⎪⎧2x+9y−5z=104x+20y+z=24x−21y+3z=8
18.10 多行等式
$\begin{aligned}f(x) & = (x + 1)^2 \\ & = x^2 + 2x + 1\end{aligned}$
$\begin{aligned}a_1 & = 1 \\ a_2 & = 2 \\ & \dots \\ a_n & = n\end{aligned}$
f ( x ) = ( x + 1 ) 2 = x 2 + 2 x + 1 \begin{aligned}f(x) & = (x + 1)^2 \\ & = x^2 + 2x + 1\end{aligned} f(x)=(x+1)2=x2+2x+1
a 1 = 1 a 2 = 2 … a n = n \begin{aligned}a_1 & = 1 \\ a_2 & = 2 \\ & \dots \\ a_n & = n\end{aligned} a1a2an=1=2…=nps:原语法为align,现在是aligned。
18.11 数组/表格
$\begin{array}{|c|c||c|}x&y&z\\8&2&4\\2&3&9\\10&\dfrac{3}{4}&\sqrt{3}\\a&b&c\end{array}$
x y z 8 2 4 2 3 9 10 3 4 3 a b c \begin{array}{|c|c||c|}x&y&z\\8&2&4\\2&3&9\\10&\dfrac{3}{4}&\sqrt{3}\\a&b&c\end{array} x8210ay2343bz493cps:\begin{array}{}←这个大括号里是形如’|c|c||c|‘这样的格式,’|'是两列的分割线,‘c’是表示这里有一列,而内容中使用’&'来分开每一列的内容。这里可能讲的不是很清楚,所以最好还是自己尝试一下。
19 字体
19.1 希腊字母
貌似洛谷对一些希腊字母不支持,也许是因为像英文字母,所以我这里只好用英文字母代替了。
希腊字母小写本质上就是希腊字母的英文(首字母小写)前面+转义符号\;
希腊字母大写本质上就是希腊字母的英文(首字母大写)前面+转义符号\;
编号 | 小写 | 大写 | 英文 | LaTex公式 (小写) | 读音 |
---|---|---|---|---|---|
1 | α | A | alpha | \alpha | /'ælfə/ |
2 | β | B | beta | \beta | /'bi:tə/or/'beɪtə/ |
3 | γ | Γ | gamma | \gamma | /'gæmə/ |
4 | δ | Δ | delta | \delta | /'deltə/ |
5 | ϵ | E | epsilon | \epsilon | /'epsɪlɒn/ |
6 | ζ | Z | zeta | \zeta | /'zi:tə/ |
7 | η | H | eta | \eta | /'i:tə/ |
8 | θ | Θ | theta | \theta | /'θi:tə/ |
9 | ι | I | iota | \iota | /aɪ’əʊtə/ |
10 | κ | K | kappa | \kappa | /'kæpə/ |
11 | λ | Λ | lambda | \lambda | /'læmdə/ |
12 | μ | M | mu | \mu | /mju:/ |
13 | ν | N | nu | \nu | /nju:/ |
14 | ξ | Ξ | xi | \xi | /ksi/or/'zaɪ/or/'ksaɪ/ |
15 | ο | O | omicron | \omicron | /əu’maikrən/or/'ɑmɪ,krɑn/ |
16 | π | Π | pi | \pi | /paɪ/ |
17 | ρ | P | rho | \rho | /rəʊ/ |
18 | σ | Σ | sigma | \sigma | /'sɪɡmə/ |
19 | τ | T | tau | \tau | /tɔ:/or/taʊ/ |
20 | υ | Υ | upsilon | \upsilon | /'ipsilon/or/'ʌpsilɒn/ |
21 | ϕ | Φ | phi | \phi | /faɪ/ |
22 | χ | X | chi | \chi | /kaɪ/ |
23 | ψ | Ψ | psi | \psi | /psaɪ/ |
24 | ω | Ω | omega | \omega | /'əʊmɪɡə/or/oʊ’meɡə/ |
注意:常用的梯度符号 ∇ 的LaTeX公式为\nabla
示例:
$\omega \Omega$
ω Ω \omega \Omega ωΩ
19.2 希伯来符号
$\aleph\beth\gimel\daleth$
ℵ ℶ ℷ ℸ \aleph\beth\gimel\daleth ℵℶℷℸ
19.3 黑板粗体
$\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZps:仅支持大写英文字母。
19.4 粗体
$\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZ
$\mathbf{abcdefghijklmnopqrstuvwxyz}$
a b c d e f g h i j k l m n o p q r s t u v w x y z \mathbf{abcdefghijklmnopqrstuvwxyz} abcdefghijklmnopqrstuvwxyz
$\mathbf{0123456789}$
0123456789 \mathbf{0123456789} 0123456789ps:支持大小写英文字母、数字和大写希腊字母。
19.5 斜体(英文字母和小写希腊字母默认)
$\mathit{A B\Gamma\Delta EZH\Theta}$
A B Γ Δ E Z H Θ \mathit{A B\Gamma\Delta EZH\Theta} ABΓΔEZHΘ
$\mathit{IK\Lambda MN\Xi O\Pi}$
I K Λ M N Ξ O Π \mathit{IK\Lambda MN\Xi O\Pi} IKΛMNΞOΠ
$\mathit{P\Sigma T\Upsilon\Phi X\Psi\Omega}$
P Σ T Υ Φ X Ψ Ω \mathit{P\Sigma T\Upsilon\Phi X\Psi\Omega} PΣTΥΦXΨΩ
$\mathit{0123456789}$
0123456789 \mathit{0123456789} 0123456789
19.6 罗马体
$\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZ
$\mathrm{abcdefghijklmnopqrstuvwxyz}$
a b c d e f g h i j k l m n o p q r s t u v w x y z \mathrm{abcdefghijklmnopqrstuvwxyz} abcdefghijklmnopqrstuvwxyz
$\mathrm{0123456789}$
0123456789 \mathrm{0123456789} 0123456789ps:支持大小写英文字母和数字。
19.7 打字机字体
$\mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZ
$\mathtt{abcdefghijklmnopqrstuvwxyz}$
a b c d e f g h i j k l m n o p q r s t u v w x y z \mathtt{abcdefghijklmnopqrstuvwxyz} abcdefghijklmnopqrstuvwxyz
$\mathtt{A B\Gamma\Delta EZH\Theta}$
A B Γ Δ E Z H Θ \mathtt{A B\Gamma\Delta EZH\Theta} ABΓΔEZHΘ
$\mathtt{IK\Lambda MN\Xi O\Pi}$
I K Λ M N Ξ O Π \mathtt{IK\Lambda MN\Xi O\Pi} IKΛMNΞOΠ
$\mathtt{P\Sigma T\Upsilon\Phi X\Psi\Omega}$
P Σ T Υ Φ X Ψ Ω \mathtt{P\Sigma T\Upsilon\Phi X\Psi\Omega} PΣTΥΦXΨΩ
$\mathtt{0123456789}$
0123456789 \mathtt{0123456789} 0123456789ps:支持大小写英文字母、大写希腊字母和数字。
19.8 无衬线体
$\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZ
$\mathsf{abcdefghijklmnopqrstuvwxyz}$
a b c d e f g h i j k l m n o p q r s t u v w x y z \mathsf{abcdefghijklmnopqrstuvwxyz} abcdefghijklmnopqrstuvwxyz
$\mathsf{A B\Gamma\Delta EZH\Theta}$
A B Γ Δ E Z H Θ \mathsf{A B\Gamma\Delta EZH\Theta} ABΓΔEZHΘ
$\mathsf{IK\Lambda MN\Xi O\Pi}$
I K Λ M N Ξ O Π \mathsf{IK\Lambda MN\Xi O\Pi} IKΛMNΞOΠ
$\mathsf{P\Sigma T\Upsilon\Phi X\Psi\Omega}$
P Σ T Υ Φ X Ψ Ω \mathsf{P\Sigma T\Upsilon\Phi X\Psi\Omega} PΣTΥΦXΨΩ
$\mathsf{0123456789}$
0123456789 \mathsf{0123456789} 0123456789ps:支持大小写英文字母、大写希腊字母和数字。
19.9 手写体/花体
$\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZ
$\mathcal{0123456789}$
0123456789 \mathcal{0123456789} 0123456789
ps:支持大写英文字母和数字。
19.10 Fraktur体
$\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZ
$\mathfrak{abcdefghijklmnopqrstuvwxyz}$
a b c d e f g h i j k l m n o p q r s t u v w x y z \mathfrak{abcdefghijklmnopqrstuvwxyz} abcdefghijklmnopqrstuvwxyz
$\mathfrak{0123456789}$
0123456789 \mathfrak{0123456789} 0123456789ps:支持大小写英文字母和数字。
19.11 小型非斜体字
$\scriptstyle\text{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
ABCDEFGHIJKLMNOPQRSTUVWXYZ \scriptstyle\text{ABCDEFGHIJKLMNOPQRSTUVWXYZ} ABCDEFGHIJKLMNOPQRSTUVWXYZ
$\scriptstyle\text{abcdefghijklmnopqrstuvwxyz}$
abcdefghijklmnopqrstuvwxyz \scriptstyle\text{abcdefghijklmnopqrstuvwxyz} abcdefghijklmnopqrstuvwxyz
$\scriptstyle\text{0123456789}$
0123456789 \scriptstyle\text{0123456789} 0123456789ps:支持大小写英文字母和数字,\text见下一栏。
19.12 混合字体
19.12.1 斜体字符
$x y z$
x y z x y z xyzps:忽略公式源码中的空格,要强制空格的看下面空格一栏。
19.12.2 非斜体字符
$\text{x y z} \text{中文}$
x y z中文 \text{x y z} \text{中文} x y z中文ps:不会忽略空格,支持大小写英文字母和数字,以及中文。
19.12.3 混合斜体与非斜体
$\text{if }n\text{ is even}$
if n is even \text{if }n\text{ is even} if n is evenps:注意在\text中使用空格来显得更好看,或者可以用强制空格代替。
20 括号
20.1 普通括号
$(\dfrac{1}{2}) (\dfrac{1}{x+\dfrac{2}{3}})$
( 1 2 ) ( 1 x + 2 3 ) (\dfrac{1}{2}) (\dfrac{1}{x+\dfrac{2}{3}}) (21)(x+321)ps:对于较大的式子显得比较难看。
20.2 根据式子大小匹配的括号
$\left(\dfrac{1}{2}\right) \left(\dfrac{1}{x+\dfrac{2}{3}}\right)$
( 1 2 ) ( 1 x + 2 3 ) \left(\dfrac{1}{2}\right) \left(\dfrac{1}{x+\dfrac{2}{3}}\right) (21)⎝⎜⎛x+321⎠⎟⎞
此功能((使用\left和\right))可以推广到不同的括号:
20.3 圆括号/小括号
$\left(\dfrac{1}{2}\right)$
( 1 2 ) \left(\dfrac{1}{2}\right) (21)
20.4 方括号/中括号
$\left[\dfrac{1}{2}\right]$
[ 1 2 ] \left[\dfrac{1}{2}\right] [21]
20.5 花括号/大括号
$\left\{\dfrac{1}{2}\right\}$
{ 1 2 } \left\{\dfrac{1}{2}\right\} {21}
20.6 角括号
$\left\langle\dfrac{1}{2}\right\rangle$
⟨ 1 2 ⟩ \left\langle\dfrac{1}{2}\right\rangle ⟨21⟩ps:\langle可以用<,\rangle可以用>。
20.7 单竖线/绝对值
$\left|\dfrac{1}{2}\right|$
∣ 1 2 ∣ \left|\dfrac{1}{2}\right| ∣∣∣∣21∣∣∣∣
20.8 双竖线
$\left\|\dfrac{1}{2}\right\|$
∥ 1 2 ∥ \left\|\dfrac{1}{2}\right\| ∥∥∥∥21∥∥∥∥
20.9 向下取整
$\left\lfloor\dfrac{1}{2}\right\rfloor$
⌊ 1 2 ⌋ \left\lfloor\dfrac{1}{2}\right\rfloor ⌊21⌋
20.10 向上取整
$\left\lceil\dfrac{1}{2}\right\rceil$
⌈ 1 2 ⌉ \left\lceil\dfrac{1}{2}\right\rceil ⌈21⌉
20.11 斜线
$\left/\dfrac{1}{2}\right/$
/ 1 2 / \left/\dfrac{1}{2}\right/ /21/
20.12 反斜线
$\left\backslash\dfrac{1}{2}\right\backslash$
\ 1 2 \ \left\backslash\dfrac{1}{2}\right\backslash \21\
20.13 上下箭头
$\left\uparrow\dfrac{1}{2}\right\uparrow$
↑ 1 2 ↑ \left\uparrow\dfrac{1}{2}\right\uparrow ⏐⏐⏐↑21⏐⏐⏐↑
$\left\Downarrow\dfrac{1}{2}\right\Downarrow$
⇓ 1 2 ⇓ \left\Downarrow\dfrac{1}{2}\right\Downarrow ⇓‖‖‖21⇓‖‖‖
$\left\updownarrow\dfrac{1}{2}\right\updownarrow$
↕ 1 2 ↕ \left\updownarrow\dfrac{1}{2}\right\updownarrow ↓⏐⏐↑21↓⏐⏐↑
因为上下箭头太多了,这里就不一一示范了
20.14 混合括号
实上述括号都可以混合使用,这里就随便列两个了。
$\left<\dfrac{1}{2}\right/$
< 1 2 / \left<\dfrac{1}{2}\right/ ⟨21/
$\left(\dfrac{1}{2},1\right]$
( 1 2 , 1 ] \left(\dfrac{1}{2},1\right] (21,1]
20.15 单左括号
上述括号都适用,这里就随便列一个。
$\left(\dfrac{1}{2}\right.$
( 1 2 \left(\dfrac{1}{2}\right. (21
20.16 单右括号
$\left.\dfrac{1}{2}\right]$
1 2 ] \left.\dfrac{1}{2}\right] 21]
20.17 强制括号大小
$\Bigg(\bigg[\Big\{\big<x\big>\Big\}\bigg]\Bigg)$
( [ { < x > } ] ) \Bigg(\bigg[\Big\{\big<x\big>\Big\}\bigg]\Bigg) ([{⟨x⟩}])ps:即使用\Bigg、\bigg、\Big、\big来控制括号大小。
21 空格
一般LaTeXLaTeX能自动处理大多数空格,但必要时候需要强制控制大小。
21.1 紧贴
宽度为-m/6
$x\!y$
x y x\!y xy
21.2 无空格
宽度为0
$xy$
x y xy xy
21.3 小空格
宽度为m/6
$x\,y$
x y x\,y xy
21.4 中等空格
宽度为2m/7
$x\;y$
x y x\;y xy
21.5 大空格
宽度为m/3
$x\ y$
x y x\ y x y
21.6 quad空格
宽度为m
$x\quad y$
x y x\quad y xy
21.7 两个quadquad空格
宽度为2m
$x\qquad y$
x y x\qquad y xy
22 颜色
语法
字体颜色:{\color{色调}表达式}
背景颜色:{\color{文字色调}\colorbox{背景色调}{表达式(可以打中文)}}
洛谷内支持的颜色(洛谷里有挺多颜色是不支持的,而且有些颜色和WikiWiki上不太一样……)
B
l
a
c
k
{\color{Black}Black}
Black
G
r
a
y
{\color{Gray}Gray}
Gray
W
h
i
t
e
{\color{White}White}
White←这是白White= =
R
e
d
{\color{Red}Red}
Red
Y
e
l
l
o
w
{\color{Yellow}Yellow}
Yellow
G
r
e
e
n
{\color{Green}Green}
Green
Y
e
l
l
o
w
G
r
e
e
n
{\color{YellowGreen}YellowGreen}
YellowGreen
F
u
c
h
s
i
a
{\color{Fuchsia}Fuchsia}
Fuchsia
G
o
l
d
{\color{Gold}Gold}
Gold
B
l
u
e
{\color{Blue}Blue}
Blue
O
r
a
n
g
e
{\color{Orange}Orange}
Orange
O
r
a
n
g
e
R
e
d
{\color{OrangeRed}OrangeRed}
OrangeRed
B
l
u
e
V
i
o
l
e
t
{\color{BlueViolet}BlueViolet}
BlueViolet
B
r
o
w
n
{\color{Brown}Brown}
Brown
C
a
d
e
t
B
l
u
e
{\color{CadetBlue}CadetBlue}
CadetBlue
C
o
r
n
f
l
o
w
e
r
B
l
u
e
{\color{CornflowerBlue}CornflowerBlue}
CornflowerBlue
C
y
a
n
{\color{Cyan}Cyan}
Cyan
D
a
r
k
O
r
c
h
i
d
{\color{DarkOrchid}DarkOrchid}
DarkOrchid
F
o
r
e
s
t
G
r
e
e
n
{\color{ForestGreen}ForestGreen}
ForestGreen
G
o
l
d
e
n
r
o
d
{\color{Goldenrod}Goldenrod}
Goldenrod
C
a
d
e
t
B
l
u
e
{\color{CadetBlue}CadetBlue}
CadetBlue
G
r
e
e
n
Y
e
l
l
o
w
{\color{GreenYellow}GreenYellow}
GreenYellow
L
a
v
e
n
d
e
r
{\color{Lavender}Lavender}
Lavender
L
i
m
e
G
r
e
e
n
{\color{LimeGreen}LimeGreen}
LimeGreen
M
a
g
e
n
t
a
{\color{Magenta}Magenta}
Magenta
M
a
r
o
o
n
{\color{Maroon}Maroon}
Maroon
O
r
c
h
i
d
{\color{Orchid}Orchid}
Orchid
P
l
u
m
{\color{Plum}Plum}
Plum
P
u
r
p
l
e
{\color{Purple}Purple}
Purple
R
o
y
a
l
B
l
u
e
{\color{RoyalBlue}RoyalBlue}
RoyalBlue
S
a
l
m
o
n
{\color{Salmon}Salmon}
Salmon
S
e
a
G
r
e
e
n
{\color{SeaGreen}SeaGreen}
SeaGreen
S
k
y
B
l
u
e
{\color{SkyBlue}SkyBlue}
SkyBlue
S
p
r
i
n
g
G
r
e
e
n
{\color{SpringGreen}SpringGreen}
SpringGreen
T
a
n
{\color{Tan}Tan}
Tan
T
h
i
s
t
l
e
{\color{Thistle}Thistle}
Thistle
T
u
r
q
u
o
i
s
e
{\color{Turquoise}Turquoise}
Turquoise
V
i
o
l
e
t
{\color{Violet}Violet}
Violet
随便举个例子:
$\color{Blue}\colorbox{Yellow}{LaTeX公式大全}$
x
=
−
b
±
b
2
−
4
a
c
2
a
x=\dfrac{-b\pm\sqrt{\color{Red}b^2-4ac}}{\color{Blue}2a}
x=2a−b±b2−4ac
$\color{Blue}\colorbox{Yellow}{LaTeX公式大全}$
LaTeX公式大全
\color{Blue}\colorbox{Yellow}{LaTeX公式大全}
LaTeX公式大全
23 把数学公式框起来
$$\boxed{\sum\limits_{i = 1}^{n} i = \dfrac{n(n - 1)}{2}}$$
ps:对于行内模式同样有效,不过大多情况用于独立模式。
∑
i
=
1
n
i
=
n
(
n
−
1
)
2
\boxed{\sum\limits_{i = 1}^{n} i = \dfrac{n(n - 1)}{2}}
i=1∑ni=2n(n−1)
转自: https://www.luogu.com.cn/blog/IowaBattleship/latex-gong-shi-tai-quan
参考:https://www.cnblogs.com/1024th/p/11623258.html