文章目录
字体变体
正体$\rm{A}$
花体$\mathcal{A} \cal{A}$
黑板粗体 $\mathbb{A} \Bbb{A}$
粗体$\bf{A} \mathbf{A}$
数学斜体$\mit{A}$
斜体加粗(表示矢量)$\boldsymbol{A} \bm{A}$
手写体$\scr{A}$ $\mathscr{A}$
显示直立文本: $\textup{文本}$
意大利斜体: $\textit{文本}$
显示小体大写文本: $\textsc{文本}$
中等权重: $\textmd{文本}$
加粗命令: $\textbf{文本}$
默认值: $\textnormal{文本}$
斜体字:$\textit{italic}$
细体字:$\textlf{light font}$
使用等宽字体:$\texttt{code}$
使用无衬线字体:$\textsf{sans-serif}$
所有字母大写:$\uppercase{CAPITALS}$
所有字母大写,但小写字母比较小:$\textsc{Small Capitals}$
更改字体颜色
使用 \color{颜色}{文字}
来更改特定的文字颜色。
输入 | 显示 | 输入 | 显示 |
---|---|---|---|
black | t e x t \color{black}{text} text | grey | t e x t \color{grey}{text} text |
silver | t e x t \color{silver}{text} text | white | t e x t \color{white}{text} text |
maroon | t e x t \color{maroon}{text} text | red | t e x t \color{red}{text} text |
yellow | t e x t \color{yellow}{text} text | lime | t e x t \color{lime}{text} text |
olive | t e x t \color{olive}{text} text | green | t e x t \color{green}{text} text |
teal | t e x t \color{teal}{text} text | auqa | t e x t \color{auqa}{text} text |
blue | t e x t \color{blue}{text} text | navy | t e x t \color{navy}{text} text |
purple | t e x t \color{purple}{text} text | fuchsia | t e x t \color{fuchsia}{text} text |
输入 \color {#rgb} {text}
来自定义更多的颜色,其中 #rgb
的 r
g
b
可输入 0-9
和 a-f
来表示红色、绿色和蓝色的纯度(饱和度)。
删除线
\sout{text} %横划线
\cancel{text} % 对角删除线
\bcancel{text} % 反斜线
\xcancel{text} % 叉删除线
t e x t t e x t t e x t t e x t \sout{text}\\ \cancel{text}\\ \bcancel{text}\\ \xcancel{text}\\ texttext text text
箭头
→
d
o
w
n
你
好
\xrightarrow[down]{你好}
你好down $\xrightarrow[down]{你好}$
你
好
→
\underrightarrow{你好}
你好 $\underrightarrow{你好}$
⇒
n
i
h
a
o
\stackrel{nihao}{\Rightarrow}
⇒nihao $\stackrel{nihao}{\Rightarrow}$
⟹
定
义
\overset{定义}{\Longrightarrow}
⟹定义 $\overset{定义}{\Longrightarrow}$
字符 | 含义 |
---|---|
\uparrow | ↑ |
\downarrow | ↓ |
\Uparrow | ⇑ |
\Downarrow | ⇓ |
\updownarrow | ↕ |
\Updownarrow | ⇕ |
\rightarrow | → |
\leftarrow | ← |
\Rightarrow | ⇒ |
\Leftarrow | ⇐ |
\leftrightarrow | ↔ |
\Leftrightarrow | ⇔ |
\longrightarrow | ⟶ |
\longleftarrow | ⟵ |
\Longrightarrow | ⟹ |
\Longleftarrow | ⟸ |
\mapsto | ↦ |
\longmapsto | ⟼ |
\hookleftarrow | ↩ |
\hookrightarrow | ↪ |
\leftharpoonup | ↼ |
\rightharpoonup | ⇀ |
\leftharpoondown | ↽ |
\rightharpoondown | ⇁ |
\rightleftharpoons | ⇌ |
\leadsto | ⇝ |
\nearrow | ↗ |
\searrow | ↘ |
\swarrow | ↙ |
\nwarrow | ↖ |
\nleftarrow | ↚ |
\nrightarrow | ↛ |
\nLeftarrow | ⇍ |
\nRightarrow | ⇏ |
\nleftrightarrow | ↮ |
\nLeftrightarrow | ⇎ |
\dashrightarrow | ⇢ |
\dashleftarrow | ⇠ |
\leftleftarrows | ⇇ |
\leftrightarrows | ⇆ |
\Lleftarrow | ⇚ |
\twoheadleftarrow | ↞ |
\leftarrowtail | ↢ |
\looparrowleft | ↫ |
\leftrightharpoons | ⇋ |
\curvearrowleft | ↶ |
\circlearrowleft | ↺ |
\Lsh | ↰ |
\upharpoonleft | ↿ |
\downharpoonleft | ⇃ |
\upuparrows | ⇈ |
\multimap | ⊸ |
\leftrightsquigarrow | ↭ |
\rightrightarrows | ⇉ |
\rightleftarrows | ⇄ |
\twoheadrightarrow | ↠ |
\rightarrowtail | ↣ |
\looparrowright | ↬ |
\rightleftharpoons | ⇌ |
\curvearrowright | ↷ |
\circlearrowright | ↻ |
\Rsh | ↱ |
\downdownarrows | ⇊ |
\upharpoonright | ↾ |
\downharpoonright | ⇂ |
\rightsquigarrow | ⇝ |
划线箭头
否定就是’not’。在箭头上就更简单,直接关键词前面加’n’就可以了。不过这种用法只对左、右箭头有效。上下箭头表示否定可以直接在前面加\not
常用箭头的简写
右箭头 → \to → 左箭头 ← \gets ← 右大箭头(推出) ⟹ \implies ⟹ 左右大箭头(等价) ⟺ \iff ⟺(if and only if)
非正向箭头
非正向箭头的命名按照标准的地图方向来命名的。比如左上就是西北,简写nw;右上就是东北,简写ne。那么把这些词加在小箭头前面,就变成了非正向的四个方向的箭头:
↙ ↗ ↖ ↘ \swarrow\nearrow\nwarrow\searrow ↙↗↖↘
半箭头-harpoon
harpoon是鱼叉的意思,它的规则是“朝向”+“harpoon”+“鱼叉勾的方向”三个词组合在一起。
⇀ ⇁ \rightharpoonup\rightharpoondown ⇀⇁
↿ ↾ \upharpoonleft\upharpoonright ↿↾
公式排布
公式编号与对齐
给公式加编号:
y=kx+b
\tag{2}
y = k x + b (2) y=kx+b \tag{2} y=kx+b(2)
公式对齐(无编号):
\begin{aligned}
a&=b\\
c&=d
\end{aligned}
a
=
b
c
=
d
\begin{aligned} a&=b\\ c&=d \end{aligned}
ac=b=d
公式对齐加编号:
\begin{align}
a&=b\\
c&=d
\end{align}
每一行&
号的地方对齐。
占位符
- 两个quad空格,符号:
\qquad
,如: x y x \qquad y xy - quad空格,符号:
\quad
,如: x y x \quad y xy - 大空格,符号
\
,如: x y x \ y x y - 中空格,符号
\:
,如: x y x \: y xy - 小空格,符号
\,
,如: x y x\,y xy - 紧贴,符号
\!
,如: x y x \! y xy
定界符与组合
- 括号,符号:
()\big(\big) \Big(\Big) \bigg(\bigg) \Bigg(\Bigg)
,如: ( ) ( ) ( ) ( ) ( ) ()\big(\big) \Big(\Big) \bigg(\bigg) \Bigg(\Bigg) ()()()()() - 中括号,符号:
[]
,如: [ x + y ] [x+y] [x+y] - 大括号,符号:
\{ \}
,如: { x + y } \{x+y\} {x+y} - 自适应括号,符号:
\left \right
,如: ( x ) \left(x\right) (x), ( x y z ) \left(x{yz}\right) (xyz) - 组合公式,符号:
{上位公式 \choose 下位公式}
,如: ( n + 1 k ) = ( n k ) + ( n k − 1 ) {n+1 \choose k}={n \choose k}+{n \choose k-1} (kn+1)=(kn)+(k−1n) - 组合公式,符号:
{上位公式 \atop 下位公式}
,如: ∑ k 0 , k 1 , … > 0 k 0 + k 1 + ⋯ = n A k 0 A k 1 ⋯ \sum_{k_0,k_1,\ldots>0 \atop k_0+k_1+\cdots=n}A_{k_0}A_{k_1}\cdots ∑k0+k1+⋯=nk0,k1,…>0Ak0Ak1⋯
数学符号
集合运算
- 属于运算,符号:
\in
,如: x ∈ y x \in y x∈y x ∋ y x \ni y x∋y - 不属于运算,符号:
\notin
,如: x ∉ y x \notin y x∈/y x ∌ y x \not\ni y x∋y - 不属于运算,符号:
\not\in
,如: x ∉ y x \not\in y x∈y - 子集运算,符号:
\subset
,如: x ⊂ y x \subset y x⊂y - 子集运算,符号:
\supset
,如: x ⊃ y x \supset y x⊃y - 真子集运算,符号:
\subseteq
,如: x ⊆ y x \subseteq y x⊆y - 非真子集运算,符号:
\subsetneq
,如: x ⊊ y x \subsetneq y x⊊y - 真子集运算,符号:
\supseteq
,如: x ⊇ y x \supseteq y x⊇y - 非真子集运算,符号:
\supsetneq
,如: x ⊋ y x \supsetneq y x⊋y - 非子集运算,符号:
\not\subset
,如: x ⊄ y x \not\subset y x⊂y - 非子集运算,符号:
\not\supset
,如: x ⊅ y x \not\supset y x⊃y - 并集运算,符号:
\cup
,如: x ∪ y x \cup y x∪y - 交集运算,符号:
\cap
,如: x ∩ y x \cap y x∩y - 差集运算,符号:
\setminus
,如: x ∖ y x \setminus y x∖y - 同或运算,符号:
\bigodot
,如: x ⨀ y x \bigodot y x⨀y - 同与运算,符号:
\bigotimes
,如: x ⨂ y x \bigotimes y x⨂y - 实数集合,符号:
\mathbb{R}
,如: R \mathbb{R} R - 自然数集合,符号:
\mathbb{Z}
,如: Z \mathbb{Z} Z - 空集,符号:
\emptyset \varnothing
,如: ∅ ∅ \emptyset \varnothing ∅∅
关系符号
- 任意 存在
\forall
\exists
∀ ∃ \forall\ \exists ∀ ∃ - 因为所以
\because
\therefore
∵ ∴ \because \quad \therefore ∵∴ - 合取
\wedge
∧ \wedge ∧ - 析取
\vee
∨ \vee ∨ - 约等于:
\approx
≈ \approx ≈ - 比较符号:
\ge \le
≥ ≤ \ge \le ≥≤\geqq\leqq
≧ ≦ \geqq\leqq ≧≦\geqslant\leqslant
⩾ ⩽ \geqslant\leqslant ⩾⩽\equiv
≡ \equiv ≡\prec\ \preceq \ \succ\ \succeq
≺ ⪯ ≻ ⪰ \prec\ \preceq \ \succ\ \succeq ≺ ⪯ ≻ ⪰ - 二元关系: 相似
\sim
∼ \sim ∼ 等价\simeq
≃ \simeq ≃
顶底标
- 符号
\hat{a}\widehat{A}
,如: a ^ A ^ \hat{a}\widehat{A} a^A - 符号
\check{a}
,如: a ˇ \check{a} aˇ - 符号
\breve{a}
,如: a ˘ \breve{a} a˘ - 符号
\tilde{a}\widetilde
,如: a ~ A ~ \tilde{a}\widetilde{A} a~A - 符号
\bar{a}\overline{A}\underline{A}
,如: a ˉ A ‾ A ‾ \bar{a}\overline{A}\underline{A} aˉAA - 矢量符号,符号
\vec{a}\overleftarrow{A}\overrightarrow{A}
,如: a ⃗ A ← A → \vec{a}\overleftarrow{A}\overrightarrow{A} aAA - 上下括号, A ⏞ A ⏟ \overbrace{A}\underbrace{A} A A
- 上下小字 b a b a \overset{a}{b}\underset{a}{b} baab
- 数学符号,符号
\acute{a}
,如: a ˊ \acute{a} aˊ - 数学符号,符号
\grave{a}
,如: a ˋ \grave{a} aˋ - 数学符号,符号
\mathring{a}
,如: a ˚ \mathring{a} a˚ - 一阶导数符号,符号
\dot{a}
,如: a ˙ \dot{a} a˙ - 二阶导数符号,符号
\ddot{a}
,如: a ¨ \ddot{a} a¨
微积分
- 极限:
\lim\limits_{t\to0}
lim t → 0 \lim\limits_{t\to0} t→0lim - 下限:
\inf\limits_{t\to0}
inf t → 0 \inf\limits_{t\to0} t→0inf - 偏导数
\partial
∂ \partial ∂ - 无穷,符号:
\infty
,如: ∞ \infty ∞
数学式中的省略号
描述 | latex |
---|---|
水平位置与减号等高\cdots | ⋯ \cdots ⋯ |
对角省略号,多用于矩\ddots | ⋱ \ddots ⋱ |
水平位置与基线平齐\ldots | … \ldots … |
垂直省略号\vdots | ⋮ \vdots ⋮ |
连分式
x = a 0 + 1 2 a 1 + 2 2 a 2 + 3 2 a 3 + 4 4 a 4 + ⋯ x = a_0 + \cfrac{1^2}{a_1 + \cfrac{2^2}{a_2 + \cfrac{3^2}{a_3 + \cfrac{4^4}{a_4 + \cdots}}}} x=a0+a1+a2+a3+a4+⋯44322212
希腊字母表
字母名称 | 大写 | markdown | 小写 | markdown |
---|---|---|---|---|
alpha | A | A | α | \alpha |
beta | B | B | β | \beta |
gamma | Γ | \Gamma | γ | \gamma |
delta | Δ | \Delta | δ | \delta |
epsilon | E | E | ϵ | \epsilon |
ε | \varepsilon | |||
zeta | Z | Z | ζ | \zeta |
eta | E | E | η | \eta |
theta | Θ | \Theta | θ | \theta |
iota | I | I | ι | \iota |
kappa | K | K | κ | \kappa |
lambda | Λ | \Lambda | λ | \lambda |
Mu | M | M | μ | \mu |
nu | N | N | ν | \nu |
xi | Ξ | \Xi | ξ | \xi |
omicron | O | O | ο | \omicron |
pi | Π | \Pi | π | \omicron |
rho | P | P | ρ | \rho |
sigma | Σ | \Sigma | σ | \sigma |
tau | T | T | τ | \tau |
upsilon | Υ | \Upsilon | υ | \upsilon |
phi | Φ | \Phi | ϕ | \phi |
φ | \varphi | |||
chi | X | X | χ | \chi |
psi | Ψ | \Psi | ψ | \psi |
其他
- 虚数,符号:
\imath
,如: ı \imath ı - 虚数,符号:
\jmath
,如: ȷ \jmath ȷ - 垂直:
\perp
\bot
⊥ \perp ⊥ ⊥ \bot ⊥ - 连乘号
\prod
∏ \prod ∏ - 角度
\angle
∠ \angle ∠ - 等号上下写东西
\xlongequal[down]{up}
= d o w n u p \xlongequal[down]{up} updown - 三角等号
\triangleq
≜ \triangleq ≜ - 加减号
\pm \mp
± ∓ \pm \mp ±∓
数组与表格使用参考
数组和表格均以 begin{array}
开头,并在其后定义列数及每一列的文本对齐属性,c
l
r
分别代表居中、左对齐及右对齐。若需要插入垂直分割线,在定义式中插入 |
,若要插入水平分割线,在下一行输入前插入 \hline
。与矩阵相似,每行元素间均须要插入 &
,每行元素以 \\
结尾,最后以 end{array}
结束数组。
使用单个数组或表格时无需声明 $
或 $$
符号。
矩阵
无框矩阵
\begin{matrix}
1&x\\
1&y
\end{matrix}
1 x 1 y \begin{matrix} 1&x\\ 1&y \end{matrix} 11xy
边框矩阵
\begin{pmatrix}
1&x\\
1&y
\end{pmatrix}
( 1 x 1 y ) \begin{pmatrix}1&x\\1&y\end{pmatrix} (11xy)
\begin{bmatrix}
1&x\\
1&y
\end{bmatrix}
[ 1 x 1 y ] \begin{bmatrix}1&x\\1&y\end{bmatrix} [11xy]
\begin{Bmatrix}
1&x\\
1&y
\end{Bmatrix}
{ 1 x 1 y } \begin{Bmatrix}1&x\\1&y\end{Bmatrix} {11xy}
\begin{vmatrix}
1&x\\
1&y
\end{vmatrix}
∣ 1 x 1 y ∣ \begin{vmatrix}1&x\\1&y\end{vmatrix} ∣∣∣∣11xy∣∣∣∣
\begin{Vmatrix}
1&x\\
1&y
\end{Vmatrix}
∥ 1 x 1 y ∥ \begin{Vmatrix}1&x\\1&y\end{Vmatrix} ∥∥∥∥11xy∥∥∥∥
带分隔符号的矩阵
\left[
\begin{array}{cc|c}
1&2&3\\4&5&6
\end{array}
\right]
\left[
\begin{array}{c}
1&2&3 \\
\hline
4&5&6
\end{array}
\right]
\left[
\begin{array}{cc:c}
1&2&3\\4&5&6
\end{array}
\right]
[
1
2
3
4
5
6
]
[
1
2
3
4
5
6
]
[
1
2
3
4
5
6
]
\left[ \begin{array}{cc|c} 1&2&3\\4&5&6 \end{array} \right] \left[ \begin{array}{c} 1&2&3 \\ \hline 4&5&6 \end{array} \right] \left[ \begin{array}{cc:c} 1&2&3\\4&5&6 \end{array} \right]
[142536][142536][142536]
其中 cc|c
代表在一个三列矩阵中的第二和第三列之间插入分割线。将|
换成:
, cc:c
表示第二列和第三列之间插入虚线。
行中矩阵
这是一个行中矩阵的示例
\bigl( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix}\bigr)
如何使条件表达式适配行高
在一些情况下,条件表达式中某些行的行高为非标准高度,此时使用 \\[2ex]
语句代替该行末尾的 \\
来让编辑器适配。
f(n) =
\begin{cases}
\frac{n}{2}, & \text{if $n$ is even} \\
3n+1, & \text{if $n$ is odd}
\end{cases}
f ( n ) = { n 2 , if n is even 3 n + 1 , if n is odd f(n) = \begin{cases} \frac{n}{2}, & \text{if $n$ is even} \\ 3n+1, & \text{if $n$ is odd} \end{cases} f(n)={2n,3n+1,if n is evenif n is odd
f(n) =
\begin{cases}
\frac{n}{2}, & \text{if $n$ is even} \\[2ex]
3n+1, & \text{if $n$ is odd}
\end{cases}
f
(
n
)
=
{
n
2
,
if
n
is even
3
n
+
1
,
if
n
is odd
f(n) = \begin{cases} \frac{n}{2}, & \text{if $n$ is even} \\[2ex] 3n+1, & \text{if $n$ is odd} \end{cases}
f(n)=⎩⎨⎧2n,3n+1,if n is evenif n is odd
一个 [ex]
指一个 “X-Height”,即x字母高度。可以根据情况指定多个 [ex]
,如 [3ex]
、[4ex]
等。
其实可以在任何地方使用 \\[2ex]
语句,只要你觉得合适。
交换图表使用
使用一行 $ \require{AMScd} $
语句来允许交换图表的显示。
声明交换图表后,语法与矩阵相似,在开头使用 begin{CD}
,在结尾使用 end{CD}
,在中间插入图表元素,每个元素之间插入 &
,并在每行结尾处使用 \\
。
\begin{CD}
A @>a>> B\\
@V b V V\# @VV c V\\
C @>>d> D
\end{CD}
其中,@>>>
代表右箭头、@<<<
代表左箭头、@VVV
代表下箭头、@AAA
代表上箭头、@=
代表水平双实线、@|
代表竖直双实线、@.
代表没有箭头。
在 @>>>
的 >>>
之间任意插入文字即代表该箭头的注释文字。
文件内链接转移
跳转目的地处加上:<a id="id">内容</a>
目的地
链接:[内容](#id)
链接