LaTeX 数学公式指南(KaTeX 版)

Powered by

\TeX \quad \LaTeX \quad \KaTeX

声调 / 变音 / 上下标 / 上下括号 / 向量

aa' a'a~\tilde{a} \tilde{a}\mathring{g} \mathring{g}
aa'' a''\widetilde{ac} \widetilde{ac}\overgroup{AB} \overgroup{AB}
aa^{\prime} a^{\prime}\utilde{AB} \utilde{AB}\undergroup{AB} \undergroup{AB}
a´\acute{a} \acute{a}F\vec{F} \vec{F}\Overrightarrow{AB} \Overrightarrow{AB}
y¯\bar{y} \bar{y}\overleftarrow{AB} \overleftarrow{AB}\overrightarrow{AB} \overrightarrow{AB}
a˘\breve{a} \breve{a}\underleftarrow{AB} \underleftarrow{AB}\underrightarrow{AB} \underrightarrow{AB}
aˇ\check{a} \check{a}\overleftharpoon{ac} \overleftharpoon{ac}\overrightharpoon{ac} \overrightharpoon{ac}
a˙\dot{a} \dot{a}\overleftrightarrow{AB} \overleftrightarrow{AB}\overbrace{AB} \overbrace{AB}
a¨\ddot{a} \ddot{a}\underleftrightarrow{AB} \underleftrightarrow{AB}\underbrace{AB} \underbrace{AB}
a`\grave{a} \grave{a}AB\overline{AB} \overline{AB}\overlinesegment{AB} \overlinesegment{AB}
θ^\hat{\theta} \hat{\theta}AB\underline{AB} \underline{AB}\underlinesegment{AB} \underlinesegment{AB}
\widehat{ac} \widehat{ac}\widecheck{ac} \widecheck{ac}\underbar{X} \underbar{X}

\text{...} 中的声调 / 变音符号

\text{\'{a}} \'{a}\text{\~{a}} \~{a}\text{\.{a}} \.{a}\text{\H{a}} \H{a}
\text{\r{a}} \r{a}\text{\={a}} \={a}\text{\"{a}} \"{a}\text{\v{a}} \v{a}
\text{\^{a}} \^{a}\text{\u{a}} \u{a}

分隔符 / 括号 / 箭头

()( ) ( )\lparen \rparen \lparen \rparen⌈ ⌉ ⌈ ⌉\lceil \rceil \lceil \rceil\uparrow \uparrow
[][ ] [ ][]\lbrack \rbrack \lbrack \rbrack⌊⌋ ⌊ ⌋\lfloor \rfloor \lfloor \rfloor\downarrow \downarrow
{}\{ \} \{ \}{}\lbrace \rbrace \lbrace \rbrace⎰⎱ ⎰⎱\lmoustache \rmoustache \lmoustache \rmoustache\updownarrow \updownarrow
⟨ ⟩ ⟨ ⟩\langle \rangle \langle \rangle⟮ ⟯ ⟮ ⟯\lgroup \rgroup \lgroup \rgroup\Uparrow \Uparrow
|$$\vert \vert┌ ┐ ┌ ┐\ulcorner \urcorner \ulcorner \urcorner
\|\|\Vert \Vert└ ┘ └ ┘\llcorner \lrcorner \llcorner \lrcorner\Updownarrow \Updownarrow
\lvert \rvert \lvert \rvert\lVert \rVert \lVert \rVert$$ ``\left. \right. \left. \right.(相信眼睛)\\backslash \backslash
\lang \rang \lang \rang<>\lt \gt \lt \gt⟦ ⟧ ⟦ ⟧\llbracket \rrbracket``\llbracket \rrbracket\lBrace \rBrace \lBrace \rBrace

分隔符大小

(AB)\left(\LARGE{AB}\right) \left(\LARGE{AB}\right)

(((((( \big( \Big( \bigg( \Bigg( ( \big( \Big( \bigg( \Bigg(

\left\big\bigl\bigm\bigr
\middle\Big\Bigl\Bigm\Bigr
\right\bigg\biggl\biggm\biggr
\Bigg\Biggl\Biggm\Biggr

环境 / 形式

1
2
3
4
5
6
7
8
9
\begin{matrix}
a & b \\
c & d
\end{matrix}
or
\begin{array}{cc}
a & b \\
c & d
\end{array}

abcd\begin{matrix} a & b \\ c & d \end{matrix}

1
2
3
4
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}

(abcd)\begin{pmatrix} a & b \\ c & d \end{pmatrix}

1
2
3
4
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}

[abcd]\begin{bmatrix} a & b \\ c & d \end{bmatrix}

1
2
3
4
\begin{vmatrix}
a & b \\
c & d
\end{vmatrix}

abcd\begin{vmatrix} a & b \\ c & d \end{vmatrix}

1
2
3
4
\begin{Vmatrix}
a & b \\
c & d
\end{Vmatrix}

abcd\begin{Vmatrix} a & b \\ c & d \end{Vmatrix}

1
2
3
4
\begin{Bmatrix}
a & b \\
c & d
\end{Bmatrix}

{abcd}\begin{Bmatrix} a & b \\ c & d \end{Bmatrix}

1
2
3
4
5
6
7
\def\arraystretch{1.5}
\begin{array}{c:c:c}
a & b & c \\ \hline
d & e & f \\
\hdashline
g & h & i
\end{array}
\def\arraystretch{1.5} \begin{array}{c:c:c} a & b & c \\ \hline d & e & f \\ \hdashline g & h & i \end{array}

此处显示有误

1
2
3
4
5
x =
\begin{cases}
a &\text{if } b \\
c &\text{if } d
\end{cases}

x={aif bcif dx = \begin{cases} a &\text{if } b \\ c &\text{if } d \end{cases}

1
2
3
4
\begin{rcases}
a &\text{if } b \\
c &\text{if } d
\end{rcases}

Error to display.(Will be fixed soon.)\text{Error to display.(Will be fixed soon.)}

1
2
3
4
\begin{smallmatrix}
a & b \\
c & d
\end{smallmatrix}

Error to display.(Will be fixed soon.)\text{Error to display.(Will be fixed soon.)}

1
2
3
4
5
6
\sum_{
\begin{subarray}{l}
i\in\Lambda\\
0<j<n
\end{subarray}
}

Error to display.(Will be fixed soon.)\text{Error to display.(Will be fixed soon.)}

HTML

\href{https://katex.org/}{\KaTeX}\href{https://katex.org/}{\KaTeX}
\url{https://katex.org/}\url{https://katex.org/}

字母与 Unicode

希腊字母

\Alpha \Alpha\Beta \BetaΓ\Gamma \GammaΔ\Delta \Delta\Epsilon \Epsilon\Zeta \Zeta
\Eta \EtaΘ\Theta \Theta\Iota \Iota\Kappa \KappaΛ\Lambda \Lambda\Mu \Mu
\Nu \NuΞ\Xi \Xi\Omicron \OmicronΠ\Pi \Pi\Rho \RhoΣ\Sigma \Sigma
\Tau \TauΥ\Upsilon \UpsilonΦ\Phi \Phi\Chi \ChiΨ\Psi \PsiΩ\Omega \Omega
\varGamma \varGamma\varDelta \varDelta\varTheta \varTheta\varLambda \varLambda\varXi \varXi\varPi \varPi
\varSigma \varSigma\varUpsilon \varUpsilon\varPhi \varPhi\varPsi \varPsi\varOmega \varOmega
α\alpha \alphaβ\beta \betaγ\gamma \gammaδ\delta \deltaϵ\epsilon \epsilonζ\zeta \zeta
η\eta \etaθ\theta \thetaι\iota \iotaκ\kappa \kappaλ\lambda \lambdaμ\mu \mu
ν\nu \nuξ\xi \xio\omicron \omicronπ\pi \piρ\rho \rhoρ\rho \rho
σ\sigma \sigmaτ\tau \tauυ\upsilon \upsilonϕ\phi \phiχ\chi \chiψ\psi \psi
ω\omega \omegaε\varepsilon \varepsilonϰ\varkappa \varkappaϑ\vartheta \vartheta\thetasym \thetasymϖ\varpi \varpi
ϱ\varrho \varrhoς\varsigma \varsigmaφ\varphi \varphiϝ\digamma \digamma

其他字母

ı\imath \imath\nabla \nabla\Im \Im\Reals \Reals\text{\OE} \text{\OE}ȷ\jmath \jmath
\partial \partial\image \image\wp \wp\text{\o} \text{\o}\aleph \aleph\Game \Game
k\Bbbk \Bbbk\weierp \weierp\text{\O} \text{\O}\alef \alef\Finv \Finv\N \N
\Z \Z\text{\ss} \text{\ss}\alefsym \alefsym\cnums \cnums\natnums \natnums\text{\aa} \text{\aa}
\text{\i} \text{\i}\beth \beth\Complex \Complex\R \R\text{\AA} \text{\AA}\text{\j} \text{\j}
\gimel \gimel\ell \ell\Re \Re\text{\ae} \text{\ae}\daleth \daleth\hbar \hbar
\real \real\text{\AE} \text{\AE}ð\eth \eth\hslash \hslash\reals \reals\text{\oe} \text{\oe}

布局

注解

\cancel{5} \cancel{5}\overbrace{a+b+c}^{\text{note}} \overbrace{a+b+c}^{\text{note}}
\bcancel{5} \bcancel{5}\underbrace{a+b+c}_{\text{note}} \underbrace{a+b+c}_{\text{note}}
\xcancel{ABC} \xcancel{ABC}\not = \not =
\sout{abc} \sout{abc}\boxed{\pi=\frac c d} \boxed{\pi=\frac c d}
1
\tag{hi} x+y^{2x}
\tag{hi} x+y^{2x}
1
\tag*{hi} x+y^{2x}
\tag*{hi} x+y^{2x}

垂直

xnx_n x_n\stackrel{!}{=} \stackrel{!}{=}a \atop b a \atop b
exe^x e^x\overset{!}{=} \overset{!}{=}\underset{!}{=} \underset{!}{=}
uo_u^o _u^o

重叠和间距

{=}\mathllap{/\,} {=}\mathllap{/\,}\left(x^{\smash{2}}\right) \left(x^{\smash{2}}\right)
\mathrlap{\,/}{=} \mathrlap{\,/}{=}\sqrt{\smash[b]{y}} \sqrt{\smash[b]{y}}
1
\sum_{\mathclap{1\le i\le j\le n}} x_{ij}
\sum_{\mathclap{1\le i\le j\le n}} x_{ij}

间距

公式结果公式结果
\,³∕₁₈ em 空格\kern{distance}空格,宽度 = distance
\thinspace³∕₁₈ em 空格\mkern{distance}空格,宽度 = distance
\>⁴∕₁₈ em 空格\mskip{distance}空格,宽度 = distance
\:⁴∕₁₈ em 空格\hskip{distance}空格,宽度 = distance
\medspace⁴∕₁₈ em 空格\hspace{distance}空格,宽度 = distance
\;⁵∕₁₈ em 空格\hspace*{distance}空格,宽度 = distance
\thickspace⁵∕₁₈ em 空格\phantom{content}间隔 content 的宽度和高度
\enspace½ em 空格\hphantom{content}间隔 content 的宽度
\quad1 em 空格\vphantom{content}间隔 content 的高度
\qquad2 em 空格\!– ³∕₁₈ em 空格
~non-breaking 的空格\negthinspace– ³∕₁₈ em 空格
\<space>空格\negmedspace– ⁴∕₁₈ em 空格
\nobreakspacenon-breaking 的空格\negthickspace– ⁵∕₁₈ em 空格
\space空格\mathstrut\vphantom{(}

逻辑与集合论

\forall \forall\complement \complement\therefore \therefore\emptyset \emptyset
\exists \exists\subset \subset\because \because\empty \empty
\exist \exist\supset \supset\mapsto \mapsto\varnothing \varnothing
\nexists \nexists\mid \mid\to \to\implies \implies
\in \in\land \land\gets \gets\impliedby \impliedby
\isin \isin\lor \lor\leftrightarrow \leftrightarrow\iff \iff
\notin \notin\ni \ni\notni \notni¬\neg \neg\lnot

\def\foo{x^2} \foo + \foo\def\foo{x^2} \foo + \foo
`\gdef\bar#1