本文从 Typora 移植过来, 部分不兼容情况已经修复, 如果需要原md文档可联系我
参考: LaTeX公式编辑
1. 希腊字母
小写字母
字母表示 | latex语法 | 字母表示 | latex语法 | 字母表示 | latex语法 |
---|---|---|---|---|---|
α \alphaα | \alpha | β \betaβ | \beta | γ \gammaγ | \gamma |
δ \deltaδ | \delta | ϵ \epsilonϵ,ε \varepsilonε | \epsilon,\varepsilon | ζ \zetaζ | \zeta |
η \etaη | \eta | θ \thetaθ,ϑ \varthetaϑ | \theta,\vartheta | ι \iotaι | \iota |
κ \kappaκ | \kappa | λ \lambdaλ | \lambda | μ \muμ | \mu |
ν \nuν | \nu | ξ \xiξ | \xi | o | o |
π \piπ,ϖ \varpiϖ | \pi,\varpi | ρ \rhoρ,ϱ \varrhoϱ | \rho,\varrho | σ \sigmaσ,ς \varsigmaς | \sigma,\varsigma |
τ \tauτ | \tau | υ \upsilonυ | \upsilon | ϕ \phiϕ,φ \varphiφ | \phi,\varphi |
χ \chiχ | \chi | ψ \psiψ | \psi | ω \omegaω | \omega |
大写字母
将首字母大写即可
字母表示 | latex语法 | 字母表示 | latex语法 | 字母表示 | latex语法 |
---|---|---|---|---|---|
A \AlphaA | \Alpha | B \BetaB | \Beta | Γ \GammaΓ | \Gamma |
Δ \DeltaΔ | \Delta | E \EpsilonE | \Epsilon | Z \ZetaZ | \Zeta |
H \EtaH | \Eta | Θ \ThetaΘ | \Theta | I \IotaI | \Iota |
K \KappaK | \Kappa | Λ \LambdaΛ | \Lambda | M \MuM | \Mu |
N \NuN | \Nu | Ξ \XiΞ | \Xi | O | O |
Π \PiΠ | \Pi | P \RhoP | \Rho | Σ \SigmaΣ | \Sigma |
T \TauT | \Tau | Υ \UpsilonΥ | \Upsilon | Φ \PhiΦ | \Phi |
X \ChiX | \Chi | Ψ \PsiΨ | \Psi | Ω \OmegaΩ | \Omega |
2. 符号
箭头符号
含义 | 符号表示 | latex语法 | 符号表示 | latex语法 | 备注 |
---|---|---|---|---|---|
左箭头 | ← \leftarrow← | \leftarrow(或\gets) | ⇐ \Leftarrow⇐ | \Leftarrow | 可用long加长 |
右箭头 | → \rightarrow→ | \rightarrow(或\to) | ⇒ \Rightarrow⇒ | \Rightarrow | 同上 |
上下箭头 | ↑ \uparrow↑,↓ \downarrow↓ | \up(down)arrow | ⇑ \Uparrow⇑,⇓ \Downarrow⇓ | \Up(Down)arrow | 同上 |
双箭头 | ↔ \leftrightarrow↔ | \leftrightarrow | ⇔ \Leftrightarrow⇔ | \Leftrightarrow | |
斜箭头 | ↘ \searrow↘,↙ \swarrow↙ ↗ \nearrow↗,↖ \nwarrow↖ | \s(n)e(w)arrow | s下,n上 e右,w左 | ||
半箭头 | ↼ \leftharpoonup↼,↽ \leftharpoondown↽,⇀ \rightharpoonup⇀,⇁ \rightharpoondown⇁或 ↿ \upharpoonleft↿,↾ \upharpoonright↾,⇃ \downharpoonleft⇃,⇂ \downharpoonright⇂ | \left(right)harpoonup(down)或 \up(down)harpoonleft(right) | harpoon两旁加 上下左右表指向 |
二元运算符
含义 | 符号 | 语法 | 备注 |
---|---|---|---|
加减乘除 | +,-,× \times×,÷ \div÷ ± \pm±,∓ \mp∓ ⋅ \cdot⋅,∖ \setminus∖ | +,-,\times,\div \pm,\mp \cdot,\setminus | |
星号 | ⋆ \star⋆,∗ \ast∗ | \star,\ast | |
∘ \circ∘,∙ \bullet∙,⊕ \oplus⊕,⊖ \ominus⊖ ⊙ \odot⊙,⊘ \oslash⊘,⊗ \otimes⊗ | \circ,\bullet,\oplus,\ominus \odot,\oslash,\otimes | ||
二元关系符 | =,≠ \ne=,≈ \approx≈,≤ \le≤ | =,\ne,\approx,\le | 详情链接 |
逻辑符号
符号 | 语法 |
---|---|
∀ \forall∀ | \forall |
∃ \exists∃,∄ \nexists∄ | \exists,\nexists |
∴ \therefore∴,∵ \because∵ | \therefore,\because |
& \And& | \And |
⋎ \curlyvee⋎,⋏ \curlywedge⋏,⋁ \bigvee⋁,⋀ \bigwedge⋀ | \curlyvee,\curlywedge,\bigvee,\bigwedge |
¬ \lnot¬ | \lnot, ,,\neg |
集合符号
符号 | 语法 |
---|---|
{} | {} |
∅ \emptyset∅,∅ \varnothing∅ | \emptyset,\varnothing |
∈ , ∉ , ∋ \in,\notin,\ni∈,∈/,∋ | \in,\notin,\ni |
∪ \cup∪,∩ \cap∩,⊔ \sqcup⊔,⊓ \sqcap⊓,∨ \vee∨,∧ \wedge∧ ⋃ , ⋂ \bigcup,\bigcap⋃,⋂ | \cup,\cap, ,,\sqcup,\sqcap, ,,\vee, ,,\wedge \bigcup,\bigcap |
⊂ , ⊃ \subset,\supset⊂,⊃ ⊆ , ⊇ \subseteq,\supseteq⊆,⊇ | \subset,\supset \subseteq,\supseteq$ |
特殊符号
只列举比较常用的符号
含义 | 符号 | 语法 | 备注 |
---|---|---|---|
百分号 | % \%% | % | 千分号:\textperthousand(但在typora打不出来) |
摄氏度 | ∘ C ^{\circ}\text{C}∘C | ^{\circ}\text{C} | 直接"C"不用"“\text{C}”"也可以,只是在typora美观点 |
无穷 | ∞ \infty∞ | \infty | |
⋮ , ⋯ , ⋱ \vdots,\cdots,\ddots⋮,⋯,⋱ | \vdots,\cdots,\ddots | ||
⅁ \Game⅁ | \Game |
3. 运算和函数
含义 | 符号 | 语法 | 备注 |
---|---|---|---|
极限 | lim n → ∞ x n \lim_{n \to \infty}x_nlimn→∞xn | \lim_{n \to \infty}x_n | |
lim n → ∞ x n \lim\limits_{n \to \infty } x_nn→∞limxn | \lim\limits_{n \to \infty}x_n | ||
lim x → x 0 y → y 0 f ( x , y ) = A \lim\limits_{x \to x_0 \atop y \to y_0}f(x,y) = Ay→y0x→x0limf(x,y)=A | \lim\limits_{x \to x_0 \atop y \to y_0}f(x,y) = A | ||
分数 | 2 4 x = 0.5 x \frac{2}{4}x=0.5x42x=0.5x | \frac{2}{4}x=0.5x 或者 {2 \over 4}x=0.5x | 还可dfrac,cfrac,tfrac |
普通操作符 | max ( x , y ) , sin x \max(x,y),\sin xmax(x,y),sinx exp a b = a b , exp a = e a \exp_a b=a^b,\exp a=e^aexpab=ab,expa=ea | \max(x,y),\sin x \exp_a b=a^b,\exp a=e^a | |
特殊操作符 | mydefine x \operatorname{mydefine} xmydefinex | \operatorname{mydefine} x | |
根式 | √ ( π ) , π , π n \surd(\pi),\sqrt{\pi},\sqrt[n]{\pi}√(π),π,nπ | \surd(\pi),\sqrt{\pi},\sqrt[n]{\pi} | |
微分和导数 | d t , d t , ∂ t , ∇ ψ dt,\mathrm{d}t,\partial t, \nabla\psidt,dt,∂t,∇ψ f ′ , f ′ , f ′ ′ , f ( 3 ) , y ˙ , y ¨ f^\prime, f', f'', f^{(3)}, \dot y, \ddot yf′,f′,f′′,f(3),y˙,y¨ | dt,\mathrm{d}t,\partial t,\nabla\psi f^\prime, f’, f’', f^{(3)}, \dot y, \ddot y | |
积分 | ∫ 1 3 1 x 2 d x \int_{1}^{3}\frac{1}{x^2}\, dx∫13x21dx | \int_{1}^{3}\frac{1}{x^2}, dx | |
∬ D d x d y \iint\limits_D dx\,dyD∬dxdy | \iint\limits_D dx,dy | 几重积分就是几个i | |
∮ \oint∮ | \oint,\unicode{8751},\unicode{8752} | 对应16进制为x222F,x2230 | |
求和 | ∑ a b , ∑ a b \sum_a^b,\textstyle \sum_a^b∑ab,∑ab | \sum_a^b,\textstyle \sum_a^b | |
连乘积 | ∏ a b , ∏ a b \prod_a^b,\textstyle \prod_a^b∏ab,∏ab | \prod_a^b,\textstyle \prod_a^b | |
余积 | ∐ a b , ∐ a b \coprod_a^b,\textstyle \coprod_a^b∐ab,∐ab | \coprod_a^b,\textstyle \coprod_a^b | |
大括号 | a + b + ⋯ + z ⏟ 26 \underbrace{ a+b+\cdots+z }_{26}26a+b+⋯+z a + b + ⋯ + z ⏞ 26 \overbrace{ a+b+\cdots+z }^{26}a+b+⋯+z26 | \underbrace{ a+b+\cdots+z }_{26} \overbrace{ a+b+\cdots+z }^{26} |
4. 矩阵和多行列式
含义 | 符号 | 语法 | 备注 |
---|---|---|---|
二项式系数 | ( n k ) \binom{n}{k}(kn) | \binom{n}{k} | 可用\tbinom,\dbinom |
矩阵 | x y z v \begin{matrix}x & y \\z & v\end{matrix}xzyv | \begin{matrix} x & y \\ z & v \end{matrix} | |
∣ x y z v ∣ \begin{vmatrix}x & y \\z & v\end{vmatrix}∣∣xzyv∣∣ | \begin{vmatrix} x & y\\ z & v \end{vmatrix} | 将vmatrix的v大写,为双竖线 | |
[ 0 ⋯ 0 ⋮ ⋱ ⋮ 0 ⋯ 0 ] \begin{bmatrix}0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0 \end{bmatrix}⎣⎡0⋮0⋯⋱⋯0⋮0⎦⎤ | \begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0 \end{bmatrix} | 将bmatrix的b大写,为大括号 | |
( x y z v ) \begin{pmatrix}x & y \\z & v\end{pmatrix}(xzyv) | \begin{pmatrix} x & y \\ z & v \end{pmatrix} | ||
条件定义 | f ( n ) f(n)f(n) ={ n / 2 , if n is even 3 n + 1 , if n is odd \begin{cases}n/2, & \text{if }n\text{ is even} \\3n+1, & \text{if }n\text{ is odd} \end{cases}{n/2,3n+1,if n is evenif n is odd | f(n) = \begin{cases} n/2, & \text{if}n\text{is even} \\ 3n+1, & \text{if}n\text{ is odd} \end{cases} | |
多行等式 | KaTeX parse error: {align} can be used only in display mode. | \begin{align} f(x) & = (a+b)^2\\ & = a^2+2ab+b^2 \end{align} | align有编号 align*无编号 |
z = a f ( x , y , z ) = x + y + z \begin{array}{lcl}z & = & a \\f(x,y,z) & = & x + y + z\end{array}zf(x,y,z)==ax+y+z | \begin{array}{lcl} z & = & a \\ f(x,y,z) & = & x + y + z \end{array} | array可通过修改{lcl}的值调整对齐方式 l左对齐,r右对齐 | |
{ 3 x + 5 y + z = 1 7 x − 2 y + 4 z = 2 − 6 x + 3 y + 2 z = 3 \begin{cases} 3x + 5y + z&=1 \\7x - 2y + 4z&=2 \\-6x + 3y + 2z&=3\end{cases}⎩⎨⎧3x+5y+z7x−2y+4z−6x+3y+2z=1=2=3 | \begin{cases} 3x+5y+z & =1 \\ 7x-2y+4z & =2 \\ -6x+3y+2z &=3 \end{cases} | ||
a b S 0 0 1 0 1 1 1 0 1 1 1 0 \begin{array}{|c|c|c|} a & b & S \\ \hline 0 & 0 & 1 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \\ 1 & 1 & 0 \end{array}a0011b0101S1110 | \begin{array}{|c|c|c|} a & b & S \\ \hline 0 & 0 & 1 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \\ 1 & 1 & 0 \end{array} |
5. 括号与空格
常用的括号符号例如( )[ ]{ }
可直接使用,但在较大的表达式显得不合适如:( π 1 + 2 x ) n ( \frac{\pi}{1+\tfrac{2}{x}} )^n(1+x2π)n
所以一般用\left(,\right)
表示( π 1 + 2 x ) n \left( \frac{\pi}{1+\frac{2}{x}} \right)^n(1+x2π)n
含义 | 符号 | 语法 | 备注 |
---|---|---|---|
可直接符号 | ( a b ) , [ a b ] , { a b } ∣ a b ∣ \left( \frac{a}{b} \right),\left[ \frac{a}{b} \right],\left\{ \frac{a}{b} \right\}\left| \frac{a}{b} \right|(ba),[ba],{ba}∣∣ba∣∣ | \left( \frac{a}{b} \right) \left[ \frac{a}{b} \right] \left{ \frac{a}{b} \right} \left| \frac{a}{b} \right| | |
角括号 | ⟨ a b ⟩ \left\langle \frac{a}{b} \right\rangle⟨ba⟩ | \left\langle \frac{a}{b} \right\rangle | |
取消一侧括号显示 | A B } → X \left. \frac{A}{B} \right\} \to XBA}→X | \left. \frac{A}{B} \right} \to X | 在取消显示的一侧加上"." |
括号大小 | ( ( ( ( ( ( \bigl( \Bigl( \biggl( \Biggl(((((( ] ] ] ] ] \Biggr] \biggr] \Bigr] \bigr] ]]]]]] | (\bigl( \Bigl( \biggl( \Biggl( \Biggr] \biggr] \Bigr] \bigr] ] | 普通<big<Big<bigg<Bigg |
空格 | a b a \qquad bab | a \qquad b | 双空格 |
a b a \quad bab | a \quad b | 单空格 | |
a b a\ ba b | a\ b或a \text{ } b | 字符空格 | |
a b \mathit{ab}ab | \mathit{ab} | 没有空格(用于多字母变量) | |
a b a\!bab | a!b | 负空格 | |
强制换行 | y = 1729 x y = 1729 − x y=1729x \\\ y=1729-xy=1729x y=1729−x | \ \ | 两个紧邻的"\" |
6. 颜色
字体颜色
格式:\color{options}{math}
第一个参数为颜色,第二个参数为公式或文本内容
符号 | 语法 |
---|---|
x 1 , 2 = − b ± b 2 − 4 a c 2 a {\color{Brown}x_{1,2}}=\frac{{\color{Bluegreen}-b}\pm\sqrt{\color{Red}b^2-4ac}}{\color{Green}2a }x1,2=2a−b±b2−4ac | {\color{Brown}x_{1,2}}=\frac{{\color{Bluegreen}-b}\pm\sqrt{\color{Red}b^2-4ac}}{\color{Green}2a } |
背景颜色
格式1:\colorbox{options}{text}
第一个参数为颜色,第二个参数为文本内容
格式2:\colorbox{options}{$\displaystyle + 公式$}
第一个参数为颜色,第二个参数为公式内容
RGB颜色和自定义
格式:\color[RGB]{R,G,B}
或者\colo{R,G,B}
R,G,B取值范围为[0,255]10或者[00,ff]16
符号 | 语法 |
---|---|
x 1 , 2 {\color{#44a920}x_{1,2}}x1,2 | {\color[RGB]{68,169,32}x_{1,2}}或{\color{#44a920}x_{1,2}} |
格式:\definecolor{mycolor}{RGB}{R,G,B}
{\color{mycolor}x_{1,2}}
符号 | 语法 |
---|---|
KaTeX parse error: Undefined control sequence: \definecolor at position 1: \̲d̲e̲f̲i̲n̲e̲c̲o̲l̲o̲r̲{mycolor}{RGB}{… | \definecolor{mycolor}{RGB}{68,169,32} {\color{mycolor}mycolor} |
默认支持颜色
A p r i c o t \color{Apricot}{Apricot}Apricot | E m e r a l d \color{Emerald}{Emerald}Emerald | O l i v e G r e e n \color{OliveGreen}{OliveGreen}OliveGreen | KaTeX parse error: Invalid color: 'Rubine Red' at position 7: \color{̲R̲u̲b̲i̲n̲e̲ ̲R̲e̲d̲}̲{Rubine Red} |
---|---|---|---|
A q u a m a r i n e \color{Aquamarine}{Aquamarine}Aquamarine | F o r e s t G r e e n \color{ForestGreen}{ForestGreen}ForestGreen | O r a n g e \color{Orange}{Orange}Orange | S a l m o n \color{Salmon}{Salmon}Salmon |
B i t t e r s w e e t \color{Bittersweet}{Bittersweet}Bittersweet | F u c h s i a \color{Fuchsia}{Fuchsia}Fuchsia | O r a n g e R e d \color{OrangeRed}{OrangeRed}OrangeRed | S e a G r e e n \color{SeaGreen}{SeaGreen}SeaGreen |
B l a c k \color{Black}{Black}Black | G o l d e n r o d \color{Goldenrod}{Goldenrod}Goldenrod | O r c h i d \color{Orchid}{Orchid}Orchid | S e p i a \color{Sepia}{Sepia}Sepia |
B l u e \color{Blue}{Blue}Blue | G r a y \color{Gray}{Gray}Gray | P e a c h \color{Peach}{Peach}Peach | S k y B l u e \color{SkyBlue}{SkyBlue}SkyBlue |
B l u e G r e e n \color{BlueGreen}{BlueGreen}BlueGreen | G r e e n \color{Green}{Green}Green | P e r i w i n k l e \color{Periwinkle}{Periwinkle}Periwinkle | S p r i n g G r e e n \color{SpringGreen}{SpringGreen}SpringGreen |
B l u e v i o l e t \color{Blueviolet}{Blueviolet}Blueviolet | G r e e n Y e l l o w \color{GreenYellow}{GreenYellow}GreenYellow | P i n e G r e e n \color{PineGreen}{PineGreen}PineGreen | T a n \color{Tan}{Tan}Tan |
B r i c k R e d \color{BrickRed}{BrickRed}BrickRed | J u n g l e G r e e n \color{JungleGreen}{JungleGreen}JungleGreen | P l u m \color{Plum}{Plum}Plum | T e a l B l u e \color{TealBlue}{TealBlue}TealBlue |
B r o w n \color{Brown}{Brown}Brown | L a v e n d e r \color{Lavender}{Lavender}Lavender | P r o c e s s B l u e \color{ProcessBlue}{ProcessBlue}ProcessBlue | T h i s t l e \color{Thistle}{Thistle}Thistle |
B u r n t O r a n g e \color{BurntOrange}{BurntOrange}BurntOrange | L i m e G r e e n \color{LimeGreen}{LimeGreen}LimeGreen | P u r p l e \color{Purple}{Purple}Purple | T u r q u o i s e \color{Turquoise}{Turquoise}Turquoise |
C a d e t B l u e \color{CadetBlue}{CadetBlue}CadetBlue | M a g e n t a \color{Magenta}{Magenta}Magenta | R a w S i e n n a \color{RawSienna}{RawSienna}RawSienna | V i o l e t \color{Violet}{Violet}Violet |
C a r n a t i o n P i n k \color{CarnationPink}{CarnationPink}CarnationPink | M a h o g a n y \color{Mahogany}{Mahogany}Mahogany | R e d \color{Red}{Red}Red | V i o l e t R e d \color{VioletRed}{VioletRed}VioletRed |
C e r u l e a n \color{Cerulean}{Cerulean}Cerulean | M a r o o n \color{Maroon}{Maroon}Maroon | R e d O r a n g e \color{RedOrange}{RedOrange}RedOrange | W h i t e \color{White}{White}White |
C o r n f l o w e r B l u e \color{CornflowerBlue}{CornflowerBlue}CornflowerBlue | M e l o n \color{Melon}{Melon}Melon | R e d v i o l e t \color{Redviolet}{Redviolet}Redviolet | W i l d S t r a w b e r r y \color{WildStrawberry}{WildStrawberry}WildStrawberry |
C y a n \color{Cyan}{Cyan}Cyan | M i d n i g h t B l u e \color{MidnightBlue}{MidnightBlue}MidnightBlue | R h o d a m i n e \color{Rhodamine}{Rhodamine}Rhodamine | Y e l l o w \color{Yellow}{Yellow}Yellow |
D a n d e l i o n \color{Dandelion}{Dandelion}Dandelion | M u l b e r r y \color{Mulberry}{Mulberry}Mulberry | R o y a l B l u e \color{RoyalBlue}{RoyalBlue}RoyalBlue | Y e l l o w G r e e n \color{YellowGreen}{YellowGreen}YellowGreen |
D a r k O r c h i d \color{DarkOrchid}{DarkOrchid}DarkOrchid | N a v y B l u e \color{NavyBlue}{NavyBlue}NavyBlue | R o y a l P u r p l e \color{RoyalPurple}{RoyalPurple}RoyalPurple | Y e l l o w O r a n g e \color{YellowOrange}{YellowOrange}YellowOrange |
版权声明:本文为cheng773608490原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。