Skip to content

常用数学符号

检测到 KaTeX 加载失败,可能会导致文中的数学公式无法正常渲染。

本页面记录了一些在写作时常用的数学符号及其在 KaTeX\KaTeX 中对应的表示方法。

#基础符号

名称 演示 代码
加号 ++ +
减号 −- -
乘号 ×\times \times
点乘 ⋅\cdot \cdot
除号 ÷\div \div
等号 == =、\eq
不等号 ≠\neq \ne、\neq
约等号 ≈\approx \approx
大于号 >> >、\gt
小于号 << <、\lt
大于等于号 ≥\geq \ge、\geq
小于等于号 ≤\leq \le、\leq
正负号 ±\pm \pm、\plusmn
无穷 ∞\infty \infty
根号 x\sqrt{x},xy\sqrt[y]{x} \sqrt{x},\sqrt[y]{x}
分数 ab\frac{a}{b} \frac{a}{b}
上取整 ⌈\lceil、⌉\rceil \lceil、\rceil
下取整 ⌊\lfloor、⌋\rfloor \lfloor、\rfloor
大括号 {\lbrace,}\rbrace \lbrace、\{,\rbrace、\}

#位运算

笔者在写作时更喜欢对与、或、异或运算使用英文单词描述、其他运算在上下文中使用汉语描述,而不是直接在公式中使用对应的符号,因为这样更容易理解。

名称 演示 代码
与 &\And, and \text{ and } \And,\text{ and }
或 ∣\mid, or \text{ or } \mid,\text{ or }
异或 ⊕\oplus, xor \text{ xor } \oplus,\text{ xor }
非 ¬\neg \neg
左移 ≪\ll \ll
右移 ≫\gg \gg

警告

如果更强调乘法而不是左移,应该使用 2x2x 代替 x≪1x \ll 1。除非这段代码特别强调移位运算,比如在位运算的上下文中。

#图论

待填坑。

#数论

名称 演示 代码
求和 ∑\sum \sum
连乘 ∏\prod \prod
取模 mod \bmod \bmod
带括号的取模 x(modp)x \pmod{p} x \pmod{p}
模意义下等于 ≡\equiv \equiv
log log⁡\log \log
gcd gcd⁡\gcd \gcd
max max⁡\max \max
min min⁡\min \min
组合数 (nk)\binom{n}{k} \binom{n}{k}
整除 ∣\mid \mid
不整除 ∤\nmid \nmid
恰整除 ∥\parallel \parallel
不恰整除 ∦\nparallel \nparallel

#集合

名称 演示 代码
对任意 ∀\forall \forall
存在 ∃\exists \exists
不存在 ∄\nexists \nexists
属于 ∈\in \in
不属于 ∉\notin \notin
子集 ⊆\subseteq \subseteq
真子集 ⫋\subsetneqq \subsetneqq
交 ∩\cap \cap
并 ∪\cup \cup
补集 ∁\complement \complement
空集 ∅\emptyset,∅\varnothing \emptyset,\varnothing
自然数 N\mathbb{N} \mathbb{N}、\N
整数 Z\mathbb{Z} \mathbb{Z}、\Z
实数 R\mathbb{R} \mathbb{R}、\R
复数 C\mathbb{C} \mathbb{C}

#逻辑

名称 演示 代码
与 ∧\land \land
或 ∨\lor \lor
非 ¬\lnot \lnot
推出 ⟹ \implies \implies
反推 ⟸ \impliedby \impliedby
等价 ⟺ \iff,⇔\Leftrightarrow \iff,\Leftrightarrow
因为 ∵\because \because
所以 ∴\therefore \therefore

#线性代数

名称 演示 代码
向量 a⃗\vec{a} \vec{a}
平均值 a‾\overline{a} \overline{a}

待填坑。

#其他

演示 代码
a+b+c⏞note\overbrace{a+b+c}^{\text{note}} \overbrace{a+b+c}^{\text{note}}
a+b+c⏟note\underbrace{a+b+c}_{\text{note}} \underbrace{a+b+c}_{\text{note}}
5\cancel{5} \cancel{5}
5\bcancel{5} \bcancel{5}
5\xcancel{5} \xcancel{5}
abc\sout{abc} \sout{abc}
5‾\overline{5} \overline{5}
≠\not = \not =
−78∘\phase{-78^\circ} \phase{-78^\circ}
π=cd\boxed{\pi=\frac c d} \boxed{\pi=\frac c d}
aba \atop b a \atop b
=!\stackrel{!}{=} \stackrel{!}{=}
=!\overset{!}{=} \overset{!}{=}
=!\underset{!}{=} \underset{!}{=}
∑0<i<m0<j<n\sum_{\substack{0<i<m\\0<j<n}} \sum_{\substack{0<i<m\\0<j<n}}

\tag{hi} x+y^{2x}

x+y2x(hi)\tag{hi} x+y^{2x}

待填坑。


KaTeX\KaTeX 对数学符号的完整支持列表详见 官方文档。