使用Typora 时常用的内联公式汇总
文章目录
1. 前言
Typora是一款轻便简洁的Markdown编辑器,支持即时渲染技术,这也是与其他Markdown编辑器最显著的区别。即时渲染使得你写Markdown就想是写Word文档一样流畅自如,不像其他编辑器的有编辑栏和显示栏。 此外,Typora与博客CSDN相联,对我们上传一些笔记是非常友好的。最近在使用过程中,在输入公式的时候,对于比较复杂的像 α \alphaα β \betaβ γ \gammaγ 等字符以及上下标等问题,经过查找,学习,做出如下总结。
2. 注意 注意 注意???
在使用之前,要确保我们的Typora 已经打开 内联函数的开关,具体步骤为 :左上角文件 → \rightarrow→ 偏好设置 → \rightarrow→ Markdown → \rightarrow→ Markdown 扩展语法 → \rightarrow→ 勾选内联公式,如下图:

3. 一些基本的内联公式
行间公式(inline):用$...$将公式括起来
块间公式(display):用$$...$$将公式括起来,默认显示在行中间
3.1 位置关系
| 展示 | 公式 | 说明 |
|---|---|---|
| x 2 x^{2}x2 | x^{2} | 右上标 |
| x 2 x_{2}x2 | x_{2} | 右下标 |
| 2 x {}^{2}x2x | {}^{2}x | 左上标 |
| 2 x {}_{2}x2x | {}_{2}x | 左下标 |
| x 2 \frac{x}{2}2x | \frac{x}{2} | 分数 |
3.2 数学符号
| 展示 | 公式 | 说明 |
|---|---|---|
| ± \pm± | \pm | 加减 |
| ∓ \mp∓ | \mp | 减加 |
| × \times× | \times | 叉乘 |
| ⋅ \cdot⋅ | \cdot | 点乘 |
| ⊕ \oplus⊕ | \oplus | 或 |
| ⊗ \otimes⊗ | \otimes | 异或 |
| ∘ \circ∘ | \circ | |
| ÷ \div÷ | \div | 除号 |
| ≠ \neq= | \neq | 不等号 |
| ≈ \approx≈ | \approx | 约等号 |
| ≡ \equiv≡ | \equiv | 恒等号 |
| ≤ \leq≤ | \leq | 小于等于 |
| ≥ \geq≥ | \geq | 大于等于 |
| ∀ \forall∀ | \forall | 任意的 |
| ∃ \exists∃ | \exists | 存在 |
| ∅ \emptyset∅ | \emptyset | 空集 |
| ∵ \because∵ | \because | 因为 |
| ∴ \therefore∴ | \therefore | 所以 |
| ∼ \sim∼ | \sim | 等价 |
| ∣ \mid∣ | \mid | |
| ∞ \infty∞ | \infty | 无穷大 |
| … \dots… | \dots | 省略号… \dots… |
| ⋯ \cdots⋯ | \cdots | 省略号⋯ \cdots⋯ |
| ∈ \in∈ | \in | 属于 |
| ∉ \notin∈/ | \notin | 不属于 |
| ⊂ \subset⊂ | \subset | 子集 |
| ⊆ \subseteq⊆ | \subseteq | |
| ∪ \cup∪ | \cup | 并集 |
| ∩ \cap∩ | \cap | 交集 |
| ⌊ x ⌋ \lfloor x\rfloor⌊x⌋ | \lfloor x\rfloor | 向下取整 |
| ⌈ x ⌉ \lceil x \rceil⌈x⌉ | \lceil x \rceil | 向上取整 |
| x \sqrt{x}x | \sqrt{x} | 开根号 |
| lim n → ∞ \lim_{n\rightarrow\infin}limn→∞ | \lim_{n\rightarrow\infin} | 求极限 |
| f ′ f'f′ | f’ | 求导 |
| ∫ 0 1 \int_{0}^{1}∫01 | \int_{0}^{1} | 定积分 |
| ∮ \oint∮ | \oint | 积分 |
| ∑ i = 0 n \sum_{i=0}^{n}∑i=0n | \sum_{i=0}^{n} | 求和 |
| ∏ i = 1 n \prod_{i=1}^{n}∏i=1n | \prod_{i=1}^{n} | 连乘 |
| ( 2 n ) \binom{2}{n}(n2) | \binom{2}{n} | 二项式系数,组合:C n 2 C_{n}^{2}Cn2 |
| ∂ \partial∂ | \partial | 偏导 |
| ∠ \angle∠ | \angle | 角度 |
| ⊥ \bot⊥ | \bot | 垂直 |
| ∇ \nabla∇ | \nabla | 哈密顿算子 |
3.3 字母上下相关
| 展示 | 公式 | 说明 |
|---|---|---|
| a ˙ \dot{a}a˙ | \dot{a} | 字母上一点 |
| a ¨ \ddot{a}a¨ | \ddot{a} | 字母上两点 |
| a ^ \hat{a}a^ | \hat{a} | 字母上一个帽子 |
| a ⃗ \vec{a}a | \vec{a} | 向量 |
| a ‾ \overline{a}a | \overline{a} | 上横线 |
| a ‾ \underline{a}a | \underline{a} | 下横线 |
| a ~ \tilde{a}a~ | \tilde{a} | 上波浪线 |
| A B → \overrightarrow{AB}AB | \overrightarrow{AB} | 多字母向量 |
| A B ^ \widehat{AB}AB | \widehat{AB} | 大帽AB |
| A B ⌢ \mathop{AB}\limits^{\frown}AB⌢ | \mathop{AB}\limits^{\frown} | 弧线AB |
| ~~ 删除线 ~~ | 删除线(注:此公式两端不需要 $ 符号) |
3.4 箭头符号
| 展示 | 公式 | 展示 | 公式 | |
|---|---|---|---|---|
| ← \leftarrow← | \leftarrow | ⟶ \longrightarrow⟶ | \longrightarrow | |
| ↔ \leftrightarrow↔ | \leftrightarrow | ⟷ \longleftrightarrow⟷ | \longleftrightarrow | |
| ⇒ \Rightarrow⇒ | \Rightarrow | ⟸ \Longleftarrow⟸ | \Longleftarrow | |
| ⇔ \Leftrightarrow⇔ | \Leftrightarrow | ⟺ \Longleftrightarrow⟺ | \Longleftrightarrow | |
| ↑ \uparrow↑ | \uparrow | ↓ \downarrow↓ | \downarrow | |
| ⇑ \Uparrow⇑ | \Uparrow | ⇓ \Downarrow⇓ | \Downarrow |
3.5 希腊字母
| 小写字母 | 公式 | 大写字母 | 公式 |
|---|---|---|---|
| α \alphaα | \alpha | A \AlphaA | \Alpha |
| β \betaβ | \beta | B \BetaB | \Beta |
| γ \gammaγ | \gamma | Γ \GammaΓ | \Gamma |
| δ \deltaδ | \delta | Δ \DeltaΔ | \Delta |
| ϵ \epsilonϵ | \epsilon | E \EpsilonE | \Epsilon |
| ε \varepsilonε | \varepsilon | ||
| ζ \zetaζ | \zeta | Z \ZetaZ | \Zeta |
| η \etaη | \eta | H \EtaH | \Eta |
| θ \thetaθ | \theta | Θ \ThetaΘ | \Theta |
| ι \iotaι | \iota | I \IotaI | \Iota |
| κ \kappaκ | \kappa | K \KappaK | \Kappa |
| λ \lambdaλ | \lambda | Λ \LambdaΛ | \Lambda |
| μ \muμ | \mu | M \MuM | \Mu |
| ν \nuν | \nu | N \NuN | \Nu |
| ξ \xiξ | \xi | Ξ \XiΞ | \Xi |
| ο \omicronο | \omicron | O \OmicronO | \Omicron |
| π \piπ | \pi | Π \PiΠ | \Pi |
| ρ \rhoρ | \rho | P \RhoP | \Rho |
| σ \sigmaσ | \sigma | S i g m a SigmaSigma | Sigma |
| τ \tauτ | \tau | T \TauT | \Tau |
| υ \upsilonυ | \upsilon | Υ \UpsilonΥ | \Upsilon |
| ϕ \phiϕ | \phi | Φ \PhiΦ | \Phi |
| φ \varphiφ | \varphi | ||
| χ \chiχ | \chi | X \ChiX | \Chi |
| ψ \psiψ | \psi | Ψ \PsiΨ | \Psi |
| ω \omegaω | \omega | Ω \OmegaΩ | \Omega |
3.6 数学函数公式
| 展示 | 公式 |
|---|---|
| sin x \sin{x}sinx | \sin{x} |
| cos x \cos{x}cosx | \cos{x} |
| tan x \tan{x}tanx | \tan{x} |
| cot x \cot{x}cotx | \cot{x} |
| sec x \sec{x}secx | \sec{x} |
| csc x \csc{x}cscx | \csc{x} |
| arcsin x \arcsin{x}arcsinx | \arcsin{x} |
| arccos x \arccos{x}arccosx | \arccos{x} |
| arctan x \arctan{x}arctanx | \arctan{x} |
| arccot x {x}x | \arccot{x} |
| a r c s e c x arcsec{x}arcsecx | \arcsec{x} |
| a r c c s c x arccsc{x}arccscx | \arccsc{x} |
| log 2 x \log_{2}{x}log2x | \log_{2}{x} |
| ln x \ln{x}lnx | \ln{x} |
| lg x \lg{x}lgx | \lg{x} |
4. 复杂公式
| 展示 | 公式 | 说明 |
|---|---|---|
| KaTeX parse error: Undefined control sequence: \leftroot at position 7: \sqrt[\̲l̲e̲f̲t̲r̲o̲o̲t̲{-4}\uproot{4}n… | \sqrt[\leftroot{-4}\uproot{4}n]{x} | 根号n(那个什么uproot啥的就是控制n的位置) |
| x → d − e − f a + b + c y x\xrightarrow[d-e-f]{a+b+c}yxa+b+cd−e−fy | x\xrightarrow[d-e-f]{a+b+c}y | |
| d o g e \color{red}dogedoge | \color{red}doge | 字体颜色样式 |
4.1 矩阵
( 1 0 ⋯ 0 0 1 ⋯ 0 ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ 1 ) \left( \begin{matrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots &\vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 1 \end{matrix} \right)⎝⎜⎜⎜⎛10⋮001⋮0⋯⋯⋱⋯00⋮1⎠⎟⎟⎟⎞
\left(
\begin{matrix}
1 & 0 & \cdots & 0 \\
0 & 1 & \cdots & 0 \\
\vdots &\vdots & \ddots & \vdots \\
0 & 0 & \cdots & 1
\end{matrix}
\right)
4.2 行列式
∣ 1 0 0 0 1 0 0 0 1 ∣ \left| \begin{matrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{matrix} \right|∣∣∣∣∣∣100010001∣∣∣∣∣∣
\left|
\begin{matrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{matrix}
\right|
4.3 方程组
{ x + y + z = 1 x 2 + y 2 + z 2 = 1 z = 0 \begin{cases} x+y+z=1\\ x^2+y^2+z^2=1\\ z=0 \end{cases}⎩⎪⎨⎪⎧x+y+z=1x2+y2+z2=1z=0
\begin{cases}
x+y+z=1\\
x^2+y^2+z^2=1\\
z=0
\end{cases}
4.4 多行等式
x = ( a + b ) 2 − ( a − b 2 ) = 4 a b \begin{aligned} x &= (a+b)^2-(a-b^2)\\ &= 4ab \end{aligned}x=(a+b)2−(a−b2)=4ab
\begin{aligned}
x &= (a+b)^2-(a-b^2)\\
&= 4ab
\end{aligned}
4.5 分段函数
f ( x ) = { x , x ≥ 0 0 , x < 0 f(x)= \begin{cases} x,\quad x\geq0\\ 0,\quad x<0 \end{cases}f(x)={x,x≥00,x<0
f(x)=
\begin{cases}
x,\quad x\geq0\\
0,\quad x<0
\end{cases}
4.6 表格
1 2 3 4 5 6 7 8 9 \begin{array}{|c|l|r|} \hline 1&2&3\\ \hline 4&5&6\\ \hline 7&8&9\\ \hline \end{array}147258369
\begin{array}{|c|l|r|}
\hline 1&2&3\\
\hline 4&5&6\\
\hline 7&8&9\\
\hline
\end{array}
参考链接
- https://blog.csdn.net/weixin_43444930/article/details/119791074
- https://blog.csdn.net/qq_33532713/article/details/108602463
- https://blog.csdn.net/weixin_36049506/article/details/105834412