Latex
Latex
1. 基础结构与命令
| 结构 | LaTeX 命令 | 渲染示例 |
|---|---|---|
| 上标 | x^{2} |
$x^{2}$ |
| 下标 | x_{i} |
$x_{i}$ |
| 上下标同时 | x_{i}^{2} |
$x_{i}^{2}$ |
| 撇号 / 导数 | f'(x)、f''(x) |
$f'(x)$ |
| 分式 | \frac{a}{b} |
$\frac{a}{b}$ |
| 小分式(行内紧凑) | \tfrac{a}{b} |
$\tfrac{a}{b}$ |
| 连分数 | \cfrac{1}{1+\cfrac{1}{x}} |
$\cfrac{1}{1+\cfrac{1}{x}}$ |
| 根号 | \sqrt{x} |
$\sqrt{x}$ |
| n 次根 | \sqrt[n]{x} |
$\sqrt[n]{x}$ |
| 求和 | \sum_{i=1}^{n} a_i |
$\sum_{i=1}^{n} a_i$ |
| 连乘 | \prod_{i=1}^{n} a_i |
$\prod_{i=1}^{n} a_i$ |
| 定积分 | \int_{0}^{1} x^2 \,\mathrm{d}x |
$\int_{0}^{1} x^2 ,\mathrm{d}x$ |
| 极限 | \lim_{x \to \infty} f(x) |
$\lim_{x \to \infty} f(x)$ |
| 公式内文本 | \text{其中} |
$\text{其中}$ |
| 自定义算子 | \operatorname{diag}(A) |
$\operatorname{diag}(A)$ |
| 上标注 | \overset{\text{def}}{=} |
$\overset{\text{def}}{=}$ |
| 下标注 | \underset{i}{\sum} |
$\underset{i}{\sum}$ |
| 带标注箭头 | \xrightarrow[n\to\infty]{f} |
$\xrightarrow[n\to\infty]{f}$ |
| 括号自适应 | \left( \frac{a}{b} \right) |
$\left( \frac{a}{b} \right)$ |
| 斜杠否定 | \not\equiv |
$\not\equiv$ |
常用公式环境:
\begin{equation} ... \end{equation} % 单行编号公式
\begin{equation*} ... \end{equation*} % 单行不编号
\begin{align} ... \end{align} % 多行对齐(& 对齐点,\\ 换行)
\begin{gather} ... \end{gather} % 多行居中
\begin{cases} ... \end{cases} % 分段函数
\begin{matrix} ... \end{matrix} % 矩阵(详见第 13 节)
2. 希腊字母
小写
| 符号 | 命令 | 符号 | 命令 |
|---|---|---|---|
| $\alpha$ | \alpha |
$\beta$ | \beta |
| $\gamma$ | \gamma |
$\delta$ | \delta |
| $\epsilon$ | \epsilon |
$\varepsilon$ | \varepsilon(变体) |
| $\zeta$ | \zeta |
$\eta$ | \eta |
| $\theta$ | \theta |
$\vartheta$ | \vartheta(变体) |
| $\iota$ | \iota |
$\kappa$ | \kappa |
| $\lambda$ | \lambda |
$\mu$ | \mu |
| $\nu$ | \nu |
$\xi$ | \xi |
| $\pi$ | \pi |
$\varpi$ | \varpi(变体) |
| $\rho$ | \rho |
$\varrho$ | \varrho(变体) |
| $\sigma$ | \sigma |
$\varsigma$ | \varsigma(变体) |
| $\tau$ | \tau |
$\upsilon$ | \upsilon |
| $\phi$ | \phi |
$\varphi$ | \varphi(变体) |
| $\chi$ | \chi |
$\psi$ | \psi |
| $\omega$ | \omega |
$\digamma$ | \digamma(古字母) |
大写
| 符号 | 命令 | 符号 | 命令 |
|---|---|---|---|
| $\Gamma$ | \Gamma |
$\Delta$ | \Delta |
| $\Theta$ | \Theta |
$\Lambda$ | \Lambda |
| $\Xi$ | \Xi |
$\Pi$ | \Pi |
| $\Sigma$ | \Sigma |
$\Upsilon$ | \Upsilon |
| $\Phi$ | \Phi |
$\Psi$ | \Psi |
| $\Omega$ | \Omega |
注:$\Alpha$、$\Beta$、$\Epsilon$ 等与拉丁字母同形,直接写大写拉丁字母即可。正体(非斜体)希腊字母用
\varGamma等(需upgreek宏包)。
3. 二元运算符
| 符号 | 命令 | 符号 | 命令 |
|---|---|---|---|
| $\pm$ | \pm |
$\mp$ | \mp |
| $\times$ | \times |
$\div$ | \div |
| $\cdot$ | \cdot |
$\ast$ | \ast |
| $\star$ | \star |
$\circ$ | \circ |
| $\bullet$ | \bullet |
$\oplus$ | \oplus |
| $\ominus$ | \ominus |
$\otimes$ | \otimes |
| $\oslash$ | \oslash |
$\odot$ | \odot |
| $\boxplus$ | \boxplus |
$\boxminus$ | \boxminus |
| $\boxtimes$ | \boxtimes |
$\boxdot$ | \boxdot |
| $\cap$ | \cap |
$\cup$ | \cup |
| $\uplus$ | \uplus |
$\Cap$ | \Cap(amssymb) |
| $\Cup$ | \Cup(amssymb) |
$\sqcap$ | \sqcap |
| $\sqcup$ | \sqcup |
$\wedge$ | \wedge |
| $\vee$ | \vee |
$\veebar$ | \veebar |
| $\barwedge$ | \barwedge |
$\triangleleft$ | \triangleleft |
| $\triangleright$ | \triangleright |
$\diamond$ | \diamond |
| $\dagger$ | \dagger |
$\ddagger$ | \ddagger |
| $\setminus$ | \setminus |
$\dotplus$ | \dotplus |
| $\ltimes$ | \ltimes |
$\rtimes$ | \rtimes |
| $\divideontimes$ | \divideontimes |
$\intercal$ | \intercal |
| $\circledast$ | \circledast |
$\circledcirc$ | \circledcirc |
| $\circleddash$ | \circleddash |
$\wr$ | \wr |
| $\amalg$ | \amalg |
$\Join$ | \Join(amssymb) |
注:
\cdot与\centerdot几乎相同;\smallsetminus(amssymb)与\setminus同形。\diamond是二元算符(两侧留空格),\Diamond是普通大符号。
4. 关系运算符
| 符号 | 命令 | 符号 | 命令 |
|---|---|---|---|
| $\neq$ | \neq(同 \ne) |
$\leq$ | \leq(同 \le) |
| $\geq$ | \geq(同 \ge) |
$\leqslant$ | \leqslant(amssymb) |
| $\geqslant$ | \geqslant(amssymb) |
$\ll$ | \ll |
| $\gg$ | \gg |
$\prec$ | \prec |
| $\succ$ | \succ |
$\preceq$ | \preceq |
| $\succeq$ | \succeq |
$\sim$ | \sim |
| $\approx$ | \approx |
$\simeq$ | \simeq |
| $\cong$ | \cong |
$\approxeq$ | \approxeq(amssymb) |
| $\equiv$ | \equiv |
$\not\equiv$ | \not\equiv |
| $\propto$ | \propto |
$\doteq$ | \doteq |
| $\Doteq$ | \Doteq |
$\triangleq$ | \triangleq |
| $\fallingdotseq$ | \fallingdotseq |
$\risingdotseq$ | \risingdotseq |
| $\asymp$ | \asymp |
$\backsimeq$ | \backsimeq |
| $\vDash$ | \vDash |
$\Vdash$ | \Vdash |
| $\Vvdash$ | \Vvdash |
$\vdash$ | \vdash |
| $\dashv$ | \dashv |
$\perp$ | \perp |
| $\mid$ | \mid |
$\nmid$ | \nmid |
| $\parallel$ | \parallel |
$\nparallel$ | \nparallel |
| $\frown$ | \frown |
$\smile$ | \smile |
| $\pitchfork$ | \pitchfork |
$\between$ | \between |
| $\lesssim$ | \lesssim |
$\gtrsim$ | \gtrsim |
| $\lessapprox$ | \lessapprox |
$\gtrapprox$ | \gtrapprox |
| $\lessgtr$ | \lessgtr |
$\gtrless$ | \gtrless |
| $\leqq$ | \leqq |
$\geqq$ | \geqq |
| $\subset$ | \subset |
$\supset$ | \supset |
| $\subseteq$ | \subseteq |
$\supseteq$ | \supseteq |
| $\subsetneq$ | \subsetneq |
$\supsetneq$ | \supsetneq |
| $\nsubseteq$ | \nsubseteq |
$\nsupseteq$ | \nsupseteq |
| $\not\subset$ | \not\subset |
$\not\supset$ | \not\supset |
| $\coloneqq$ | \coloneqq(mathtools) |
$\eqqcolon$ | \eqqcolon(mathtools) |
| $\bowtie$ | \bowtie |
注:
\coloneqq(定义为)、\eqqcolon等「冒号等号」由mathtools宏包提供。任何关系符都可以用\not前缀否定(如\not\in),但优先用现成的(\notin、\neq)。
5. 箭头
| 符号 | 命令 | 符号 | 命令 |
|---|---|---|---|
| $\to$ | \to(同 \rightarrow) |
$\gets$ | \gets(同 \leftarrow) |
| $\leftrightarrow$ | \leftrightarrow |
$\Rightarrow$ | \Rightarrow |
| $\Leftarrow$ | \Leftarrow |
$\Leftrightarrow$ | \Leftrightarrow |
| $\mapsto$ | \mapsto |
$\longmapsto$ | \longmapsto |
| $\longrightarrow$ | \longrightarrow |
$\longleftarrow$ | \longleftarrow |
| $\longleftrightarrow$ | \longleftrightarrow |
$\Longrightarrow$ | \Longrightarrow |
| $\Longleftarrow$ | \Longleftarrow |
$\Longleftrightarrow$ | \Longleftrightarrow |
| $\hookrightarrow$ | \hookrightarrow |
$\hookleftarrow$ | \hookleftarrow |
| $\twoheadrightarrow$ | \twoheadrightarrow |
$\rightrightarrows$ | \rightrightarrows |
| $\leftleftarrows$ | \leftleftarrows |
$\rightleftarrows$ | \rightleftarrows |
| $\leftrightarrows$ | \leftrightarrows |
$\rightleftharpoons$ | \rightleftharpoons |
| $\leftrightharpoons$ | \leftrightharpoons |
$\rightharpoonup$ | \rightharpoonup |
| $\leftharpoonup$ | \leftharpoonup |
$\rightharpoondown$ | \rightharpoondown |
| $\leftharpoondown$ | \leftharpoondown |
$\uparrow$ | \uparrow |
| $\downarrow$ | \downarrow |
$\updownarrow$ | \updownarrow |
| $\Uparrow$ | \Uparrow |
$\Downarrow$ | \Downarrow |
| $\Updownarrow$ | \Updownarrow |
$\nearrow$ | \nearrow |
| $\searrow$ | \searrow |
$\nwarrow$ | \nwarrow |
| $\swarrow$ | \swarrow |
$\circlearrowright$ | \circlearrowright |
| $\circlearrowleft$ | \circlearrowleft |
$\curvearrowleft$ | \curvearrowleft |
| $\curvearrowright$ | \curvearrowright |
$\leadsto$ | \leadsto |
| $\rightsquigarrow$ | \rightsquigarrow |
$\dashrightarrow$ | \dashrightarrow |
| $\dashleftarrow$ | \dashleftarrow |
$\nrightarrow$ | \nrightarrow |
| $\nleftarrow$ | \nleftarrow |
$\Lleftarrow$ | \Lleftarrow |
| $\Rrightarrow$ | \Rrightarrow |
$\upuparrows$ | \upuparrows |
| $\downdownarrows$ | \downdownarrows |
$\multimap$ | \multimap |
注:带上下标的标注箭头用
\xrightarrow{上标}[下标]和\xleftarrow{上标}[下标](amsmath),如\xrightarrow{f}→ $\xrightarrow{f}$。
6. 集合与数集
| 符号 | 命令 | 符号 | 命令 |
|---|---|---|---|
| $\in$ | \in |
$\ni$ | \ni(同 \owns) |
| $\notin$ | \notin |
$\emptyset$ | \emptyset |
| $\varnothing$ | \varnothing(更圆润,amssymb) |
$\complement$ | \complement |
| $\cup$ | \cup |
$\cap$ | \cap |
| $\bigcup$ | \bigcup |
$\bigcap$ | \bigcap |
| $\bigsqcup$ | \bigsqcup |
$\setminus$ | \setminus |
| $\wp$ | \wp |
$\sqsubset$ | \sqsubset |
| $\sqsupset$ | \sqsupset |
$\sqsubseteq$ | \sqsubseteq |
| $\sqsupseteq$ | \sqsupseteq |
常用数集(双线体,需 amssymb / amsfonts)
| 符号 | 命令 | 含义 |
|---|---|---|
| $\mathbb{N}$ | \mathbb{N} |
自然数 |
| $\mathbb{Z}$ | \mathbb{Z} |
整数 |
| $\mathbb{Q}$ | \mathbb{Q} |
有理数 |
| $\mathbb{R}$ | \mathbb{R} |
实数 |
| $\mathbb{C}$ | \mathbb{C} |
复数 |
| $\mathbb{H}$ | \mathbb{H} |
四元数 |
| $\mathbb{F}$ | \mathbb{F} |
任意域 |
| $\mathbb{P}$ | \mathbb{P} |
概率空间 |
| $\aleph$ | \aleph |
阿列夫数 |
| $\beth$ | \beth |
贝特数 |
| $\gimel$ | \gimel |
吉梅尔数 |
| $\daleth$ | \daleth |
达莱特数 |
其他数学字体:
| 命令 | 渲染 | 说明 |
|---|---|---|
\mathcal{L} |
$\mathcal{L}$ | 花体 |
\mathfrak{g} |
$\mathfrak{g}$ | 哥特体(需 eufrak,amssymb 自动加载) |
\mathbf{x} |
$\mathbf{x}$ | 粗体 |
\mathrm{d} |
$\mathrm{d}$ | 正体(微分 d 推荐) |
\mathsf{x} |
$\mathsf{x}$ | 无衬线体 |
\mathtt{x} |
$\mathtt{x}$ | 打字机体 |
\boldsymbol{\beta} |
$\boldsymbol{\beta}$ | 粗斜体(amsmath) |
\bm{\beta} |
— | 粗斜体(bm 宏包,效果更好,KaTeX 不支持) |
\mathscr{A} |
— | 花体变体(mathrsfs 宏包) |
7. 逻辑与数字电路符号
| 符号 | 命令 | 符号 | 命令 |
|---|---|---|---|
| $\land$ | \land(同 \wedge) |
$\lor$ | \lor(同 \vee) |
| $\neg$ | \neg(同 \lnot) |
$\veebar$ | \veebar(异或) |
| $\oplus$ | \oplus(异或) |
$\odot$ | \odot(同或 XNOR) |
| $\to$ | \to(蕴含) |
$\leftrightarrow$ | \leftrightarrow(等价) |
| $\forall$ | \forall |
$\exists$ | \exists |
| $\nexists$ | \nexists(amssymb) |
$\therefore$ | \therefore(amssymb) |
| $\because$ | \because(amssymb) |
$\vdash$ | \vdash |
| $\vDash$ | \vDash |
$\top$ | \top |
| $\bot$ | \bot |
$\Box$ | \Box(必然,amssymb) |
| $\Diamond$ | \Diamond(可能,amssymb) |
$\bigoplus$ | \bigoplus |
数字电路常用写法:
| 含义 | 写法(渲染) | 命令 |
|---|---|---|
| 取反 | $\overline{A}$ | \overline{A} |
| 短杠取反 | $\bar{A}$ | \bar{A} |
| 与非 NAND | $\overline{A \cdot B}$ | \overline{A \cdot B} |
| 或非 NOR | $\overline{A+B}$ | \overline{A+B} |
| 异或 XOR | $A \oplus B$ | A \oplus B |
| 同或 XNOR | $A \odot B$ | A \odot B |
| 多输入异或 | $\bigoplus_{i=1}^{n} A_i$ | \bigoplus_{i=1}^{n} A_i |
8. 微积分与求和
| 符号 | 命令 | 符号 | 命令 |
|---|---|---|---|
| $\int$ | \int |
$\iint$ | \iint |
| $\iiint$ | \iiint |
\iiiint |
\iiiint(四重积分,LaTeX amsmath 与 MathJax 支持,KaTeX 不支持) |
| $\oint$ | \oint |
$\oiint$ | \oiint(LaTeX 需 esint 宏包) |
| $\partial$ | \partial |
$\nabla$ | \nabla |
| $\sum$ | \sum |
$\prod$ | \prod |
| $\coprod$ | \coprod |
$\infty$ | \infty |
| $\lim$ | \lim |
$\limsup$ | \limsup |
| $\liminf$ | \liminf |
$\sup$ | \sup |
| $\inf$ | \inf |
$\max$ | \max |
| $\min$ | \min |
$\ell$ | \ell(花体 l) |
| $\hbar$ | \hbar |
$\Re$ | \Re |
| $\Im$ | \Im |
$\imath$ | \imath(无点 i) |
| $\jmath$ | \jmath(无点 j) |
$\mathrm{d}x$ | \mathrm{d}x(微分 d 用正体) |
| $\dot{x}$ | \dot{x} |
$\ddot{x}$ | \ddot{x} |
注:行内公式中
\sum、\int的上下限默认放在侧面;想强制放在正上下方用\limits(如\sum\limits_{i=1}^{n}),反之用\nolimits。多重闭曲面积分\oiint等在 LaTeX 中需要esint宏包(KaTeX / MathJax 直接支持)。
9. 几何符号
| 符号 | 命令 | 符号 | 命令 |
|---|---|---|---|
| $\angle$ | \angle |
$\measuredangle$ | \measuredangle |
| $\sphericalangle$ | \sphericalangle |
$\triangle$ | \triangle |
| $\blacktriangle$ | \blacktriangle |
$\triangledown$ | \triangledown |
| $\blacktriangledown$ | \blacktriangledown |
$\square$ | \square |
| $\blacksquare$ | \blacksquare |
$\lozenge$ | \lozenge |
| $\blacklozenge$ | \blacklozenge |
$\bigcirc$ | \bigcirc |
| $\perp$ | \perp |
$\parallel$ | \parallel |
| $\nparallel$ | \nparallel |
$\cong$ | \cong |
| $\sim$ | \sim |
$\frown$ | \frown |
| $\smile$ | \smile |
$^{\circ}$ | ^\circ(度) |
注:度数最通用写法是
^\circ(如90^\circ);\degree由 siunitx 或 gensymb 宏包提供。
10. 重音与修饰
| 符号 | 命令 | 符号 | 命令 |
|---|---|---|---|
| $\hat{x}$ | \hat{x} |
$\widehat{xyz}$ | \widehat{xyz} |
| $\bar{x}$ | \bar{x} |
$\overline{xyz}$ | \overline{xyz} |
| $\vec{x}$ | \vec{x} |
$\overrightarrow{AB}$ | \overrightarrow{AB} |
| $\overleftarrow{AB}$ | \overleftarrow{AB} |
$\tilde{x}$ | \tilde{x} |
| $\widetilde{xyz}$ | \widetilde{xyz} |
$\dot{x}$ | \dot{x} |
| $\ddot{x}$ | \ddot{x} |
$\dddot{x}$ | \dddot{x} |
| $\ddddot{x}$ | \ddddot{x} |
$\acute{x}$ | \acute{x} |
| $\grave{x}$ | \grave{x} |
$\breve{x}$ | \breve{x} |
| $\check{x}$ | \check{x} |
$\mathring{x}$ | \mathring{x} |
| $\underline{x}$ | \underline{x} |
$\underbrace{x+y}_{n}$ | \underbrace{x+y}_{n} |
| $\overbrace{x+y}^{n}$ | \overbrace{x+y}^{n} |
$\boxed{x}$ | \boxed{x} |
| $x^{\prime}$ | x^{\prime}(撇号) |
$\cancel{x}$ | \cancel{x}(cancel 宏包) |
注:
\hat、\bar只覆盖单个字符,多字符用\widehat、\overline。删除线\cancel、\bcancel、\xcancel需要cancel宏包(KaTeX 内置支持)。
11. 常用函数名(正体,LaTeX 内置)
| 命令 | 渲染 | 命令 | 渲染 |
|---|---|---|---|
\sin x |
$\sin x$ | \cos x |
$\cos x$ |
\tan x |
$\tan x$ | \cot x |
$\cot x$ |
\sec x |
$\sec x$ | \csc x |
$\csc x$ |
\arcsin x |
$\arcsin x$ | \arctan x |
$\arctan x$ |
\sinh x |
$\sinh x$ | \cosh x |
$\cosh x$ |
\tanh x |
$\tanh x$ | \log x |
$\log x$ |
\ln x |
$\ln x$ | \lg x |
$\lg x$ |
\exp(x) |
$\exp(x)$ | \det A |
$\det A$ |
\gcd(a,b) |
$\gcd(a,b)$ | \arg z |
$\arg z$ |
\Pr(A) |
$\Pr(A)$ | a \bmod b |
$a \bmod b$ |
a \equiv b \pmod{n} |
$a \equiv b \pmod{n}$ |
自定义函数名:
\operatorname{Re}(z) % 一次性
\DeclareMathOperator{\sign}{sign} % 导言区声明,之后用 \sign
12. 分隔符与括号
| 符号 | 命令 | 符号 | 命令 |
|---|---|---|---|
| $( )$ | ( ) |
$[ ]$ | [ ] |
| ${ }$ | \{ \} |
$\langle x \rangle$ | \langle \rangle |
| $\lceil x \rceil$ | \lceil \rceil |
$\lfloor x \rfloor$ | \lfloor \rfloor |
| $\lvert x \rvert$ | \lvert \rvert(单竖线) |
$\lVert x \rVert$ | \lVert \rVert(双竖线,范数) |
| $\backslash$ | \backslash |
$\left( \frac{a}{b} \right)$ | \left( ... \right) 自适应 |
其他常用写法:
| 用途 | 命令 | 渲染 |
|---|---|---|
| 自适应花括号+中间竖线 | \left\{ x \mid x > 0 \right\} |
$\left{ x \mid x > 0 \right}$ |
| 手动调级 | \bigl( \Bigl( \biggl( \Biggl( |
$\bigl( \Bigl( \biggl( \Biggl($ |
| 集合竖线 | \mid(比 \vert 间距更好) |
$a \mid b$ |
注:不要直接用键盘的
|当分隔符,用\mid、\lvert、\lVert间距才正确;\left ... \right必须成对出现,中间可加\middle|。
13. 矩阵与对齐环境
% 圆括号矩阵
\begin{pmatrix} a & b \\ c & d \end{pmatrix}
% 方括号矩阵
\begin{bmatrix} a & b \\ c & d \end{bmatrix}
% 行列式(单竖线)
\begin{vmatrix} a & b \\ c & d \end{vmatrix}
% 范数(双竖线)
\begin{Vmatrix} a & b \\ c & d \end{Vmatrix}
% 无括号
\begin{matrix} a & b \\ c & d \end{matrix}
% 花括号
\begin{Bmatrix} a & b \\ c & d \end{Bmatrix}
% 行内小矩阵
\begin{smallmatrix} a & b \\ c & d \end{smallmatrix}
省略号:\dots(通用)、\ldots(靠下,$a_1, \ldots, a_n$)、\cdots(居中,$a_1 + \cdots + a_n$)、\vdots(竖)、\ddots(斜)、\hdotsfor{n}(整行横省略号,用于矩阵)。
分段函数:
f(x) = \begin{cases}
x^2, & x \ge 0 \\
-x, & x < 0
\end{cases}
多行对齐:
\begin{align}
y &= mx + b \\
E &= mc^2
\end{align}
注:
&标记对齐点,\\换行;不想要编号用align*或行末加\nonumber;自定义编号用\tag{A1}。
14. 空格控制
| 命令 | 宽度 | 命令 | 宽度 |
|---|---|---|---|
\, |
3/18 em(细,$a,b$) | \: |
4/18 em |
\; |
5/18 em($a;b$) | \! |
-3/18 em(负空格,$a!b$) |
\quad |
1 em($a\quad b$) | \qquad |
2 em($a\qquad b$) |
\enspace |
0.5 em | \hspace{1cm} |
任意宽度 |
\phantom{x} |
隐形占位(占 x 的宽度) | ~ |
不可断行空格(文本模式) |
积分里的常用习惯:
\int x \,\mathrm{d}x(积分号和 dx 之间加细空格)。
15. 杂项符号
| 符号 | 命令 | 符号 | 命令 |
|---|---|---|---|
| $\ldots$ | \ldots |
$\cdots$ | \cdots |
| $\vdots$ | \vdots |
$\ddots$ | \ddots |
| $\S$ | \S(分节号) |
$\P$ | \P(段落号) |
| $\copyright$ | \copyright |
$\textregistered$ | \textregistered |
| $\dagger$ | \dagger |
$\ddagger$ | \ddagger |
| $\clubsuit$ | \clubsuit |
$\diamondsuit$ | \diamondsuit |
| $\heartsuit$ | \heartsuit |
$\spadesuit$ | \spadesuit |
| $\flat$ | \flat |
$\natural$ | \natural |
| $\sharp$ | \sharp |
$\checkmark$ | \checkmark(amssymb) |
| $\bigstar$ | \bigstar |
$\mho$ | \mho(姆欧,amssymb) |
| $\pounds$ | \pounds |
‰ | \textperthousand(textcomp 宏包;MathJax 支持,KaTeX 不支持) |
| $\imath$ | \imath |
$\jmath$ | \jmath |
| $\prime$ | \prime |
16. 单位(siunitx 宏包)——工程文档推荐
电子/芯片文档中的单位和数字推荐用 siunitx,保证正体、间距、前缀规范:
\SI{3.3}{\volt} % 数值+单位 → 3.3 V
\SI{100}{\mega\hertz} % 100 MHz
\si{\micro\second} % 纯单位 → µs
\num{1.2e5} % 纯数字科学计数法
| 命令 | 单位 | 命令 | 单位 |
|---|---|---|---|
\volt |
V(伏) | \ampere |
A(安) |
\ohm |
Ω(欧姆) | \watt |
W(瓦) |
\joule |
J(焦) | \farad |
F(法拉) |
\henry |
H(亨利) | \hertz |
Hz(赫兹) |
\coulomb |
C(库仑) | \siemens |
S(西门子) |
\weber |
Wb(韦伯) | \tesla |
T(特斯拉) |
\newton |
N(牛顿) | \pascal |
Pa(帕斯卡) |
\kelvin |
K(开尔文) | \celsius |
℃(摄氏度) |
\meter |
m(米) | \second |
s(秒) |
\gram |
g(克) | \liter |
L(升) |
\byte |
B(字节) | \bit |
bit(比特) |
\decibel |
dB(分贝) | \percent |
% |
\degree |
°(度) |
常用前缀:\nano(n)、\micro(µ)、\milli(m)、\kilo(k)、\mega(M)、\giga(G)、\tera(T)、\pico(p)、\femto(f);二进制前缀:\kibi、\mebi、\gibi(Ki、Mi、Gi)。
不用 siunitx 时的替代:Ω 用 \Omega → $\Omega$,µ 用 \mu → $\mu$,度用 ^\circ → $^{\circ}$。
17. 电路符号(circuitikz 宏包)——芯片设计相关
circuitikz 基于 TikZ,可直接在 LaTeX 里画电路图:
\usepackage{circuitikz}
...
\begin{circuitikz}
\draw (0,0) to[V=$V_{in}$] (0,2)
to[R=$R_1$] (3,2)
to[C=$C$] (3,0) -- (0,0);
\draw (0,0) node[ground]{};
\end{circuitikz}
常用元件(to[...] 语法或 node[...]):
| 元件 | 写法 | 元件 | 写法 |
|---|---|---|---|
| 电阻 | to[R] |
欧式电阻 | to[european resistor] |
| 电容 | to[C] |
电感 | to[L] |
| 电压源 | to[V] |
电流源 | to[I] |
| 正弦源 | to[sV] |
电池 | to[battery1] |
| 二极管 | to[D] |
发光二极管 | to[leD] |
| 齐纳二极管 | to[zD] |
NPN 三极管 | to[npn] |
| PNP 三极管 | to[pnp] |
NMOS | to[nmos] |
| PMOS | to[pmos] |
运放 | to[op amp] |
| 地 | node[ground]{} |
电源 | node[vcc]{} / node[vee]{} |
| 开路 | to[open] |
短接 | to[short] |
| 传输线 | to[TL] |
开关 | to[switch] |
| 电流表 | to[ammeter] |
电压表 | to[voltmeter] |
| 与门 | node[and port] |
与非门 | node[nand port] |
| 或门 | node[or port] |
或非门 | node[nor port] |
| 异或门 | node[xor port] |
同或门 | node[xnor port] |
| 非门 | node[not port] |
缓冲器 | node[buffer port] |
注:circuitikz 文档(英文)非常详尽,官网 manual 可查全部元件;需要画时序图还可以用
tikz-timing宏包。
18. 特殊字符转义(文本模式)
| 字符 | 写法 | 字符 | 写法 |
|---|---|---|---|
| % | \% |
$ | \$ |
| & | \& |
# | \# |
| _ | \_ |
{ | \{ |
| } | \} |
~ | \textasciitilde |
\textasciicircum |
\ | \textbackslash |
注:数学模式中
{ } _ ^ % & # $ \同样有特殊含义,按 LaTeX 语法使用即可。连字符:--短横、---长横(文本模式)。
19. 常用宏包速览
| 宏包 | 提供内容 | 说明 |
|---|---|---|
| amsmath | align / cases / matrix / 分式等 | 必装 |
| amssymb | \mathbb / \nexists / \therefore 等大量符号 |
必装(自动加载 amsfonts) |
| mathtools | amsmath 增强、\coloneqq、\DeclarePairedDelimiter |
推荐 |
| bm | \bm 粗斜体 |
常用 |
| siunitx | 单位与数字排版 | 工程文档推荐 |
| circuitikz | 电路图 | 硬件文档 |
| esint | \oiint 等闭积分 |
需要时 |
| cancel | \cancel 删除线 |
需要时 |
| upgreek | \varGamma 正体希腊字母 |
需要时 |
| mathrsfs | \mathscr 花体 |
需要时 |
| stmaryrd | 更多箭头/关系符 | 需要时 |
| wasysym | 杂项符号 | 需要时 |
| mhchem | 化学式 | 需要时 |
| unicode-math | 直接输入 Unicode 符号 | XeLaTeX / LuaLaTeX |
20. 实用技巧
- 手写识别查符号:Detexify(https://detexify.kirelabs.org)——用鼠标画一个符号,自动反查 LaTeX 命令。
- 万能否定:任何关系符前加
\not(如\not\in→ $\not\in$),但优先用现成的\notin、\neq、\nmid。 - 记不住就查:本表没收录的冷门符号,直接问 AI(比如我)最快。
- 编号控制:
\tag{A1}自定义编号、\nonumber取消本行编号、equation*整个不编号。 - 中文/文字进公式:用
\text{...}。 - 上下标对齐:
\vphantom{高符号}可以让括号等高,\smash{x}忽略高度(排版微调)。 - Obsidian 渲染:设置里开启数学公式(MathJax)即可;
$...$行内、$$...$$独立成行,本表「符号」列就是可渲染格式。
支持与分享
如果这篇文章对你有帮助,欢迎分享给更多人或打赏支持!
- 作者
- Bed
- 发布于
- 2026-11-02
- 许可协议
- 保留所有权利

评论区
分享你的想法,与大家交流讨论
正在加载评论…