markdown公式编写备忘录

首先展示一下插入公式的两种格式:

(1)插入行内公式:【$ + 空格】组合。

(2)块公式:【$$ + 回车】组合。

行内公式:
$ F(x) = e^x $

块公式:
$$
F(x) = e^x 
$$

行内公式效果:$ F(x) = e^x $

块公式效果:
F ( x ) = e x F(x) = e^x F(x)=ex
这里块内的公式自动进行编号,使用typora进行编写markdown,具体操作可以参考博文【【Typora&Markdown使用】行内公式不显示】。

其次说明,下面的操作中如果是单个字母,就直接进行编写;如果是多个字母,使用 {} 括起来。例如:单个下标(代码:x_i): x i x_i xi;多个字母的下标(代码:x_{max}): x m a x x_{max} xmax

最后再补充一句,行内公式和文本如果有冲突,可以使用转义符号 \ ;公式中,使用 \ ; \quad \qquad 增加间隙。

希腊字母

名称 大写 Tex 小写 Tex
alpha A A α \alpha
beta B B β \beta
gamma Γ \Gamma γ \gamma
delta Δ \Delta δ \delta
epsilon E E ϵ \epsilon
zeta Z Z ζ \zeta
eta H H η \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 π \pi
rho P P ρ \rho
sigma Σ \Sigma σ \sigma
tau T T τ \tau
phi Φ \Phi ϕ \phi
chi X X χ \chi
psi Ψ \Psi ψ \psi
omega Ω \Omega ω \omega

上标、下标

说明 代码 结果
上缀^ x^2 x 2 x^2 x2
下缀_ x_i x i x_i xi
组合 x_i^2 或 x^2_i x i 2 x_i^2 xi2

运算符

语法:\times、\ast、\div、\pm、\mp、\leq、\geq、\lessgtr

效果: × \times × ∗ \ast ÷ \div ÷ ± \pm ± ∓ \mp ≤ \leq ≥ \geq ≶ \lessgtr

累加、累乘、积分及交并集

\infty ∞ \infty

说明 代码 结果
累加求和 \sum ∑ \sum
\sum_{i=0}^\infty i^2 ∑ i = 0 ∞ i 2 \sum_{i=0}^\infty i^2 i=0i2
累乘 \prod ∏ \prod
积分 \int ∫ \int
并集 \bigcup ⋃ \bigcup
交集 \bigcap ⋂ \bigcap
二重积分 \iint ∬ \iint
三重积分 \iiint ∭ \iiint

加上下标(以累加为例):

  • 上标 \sum^n : ∑ n \sum^n n

  • 下标 \sum_{k=1} : ∑ k = 1 \sum_{k=1} k=1

  • 正上 \sum\limits^n : ∑ n \sum\limits^n n

  • 正下 \sum\limits_{k=1} : ∑ k = 1 \sum\limits_{k=1} k=1

    注意,这里正上方和正下方使用的 \limits 只能与操作符(operator)一起使用。如果想在字母或者非操作符正上方或正下方添加,使用 \underset 。如下示例。

\underset {下面的字母}{上面的字母}
示例:$\underset {\theta}{min}$

示例效果: m i n θ \underset {\theta}{min} θmin

分式与根式

说明 代码 效果
分式表达1 \frac{a+1}{b+1} a + 1 b + 1 \frac{a+1}{b+1} b+1a+1
分式表达2 a+1\over b+1 a + 1 b + 1 {a+1\over b+1} b+1a+1
根式表达 \sqrt[x]y y x \sqrt[x]{y} xy

公式中的括号

代码 效果
(\frac{\sqrt x}{y^3}) ( x y 3 ) (\frac{\sqrt x}{y^3}) (y3x )
\left(\frac{\sqrt x}{y^3}\right) ( x y 3 ) \left(\frac{\sqrt x}{y^3}\right) (y3x )
{ x } { x } \{ x \} { x}
\vert x \vert ∣ x ∣ \vert x \vert x
\Vert x \Vert ∥ x ∥ \Vert x \Vert x
\langle x \rangle ⟨ x ⟩ \langle x \rangle x
\lceil x \rceil ⌈ x ⌉ \lceil x \rceil x
\lfloor x \rfloor ⌊ x ⌋ \lfloor x \rfloor x

使用 \left(或\right)使符号大小与邻近的公式相适应(该语句适用于所有括号类型),如上面表格中的第二个。

多行表达式

条件表达式

基本语法
\begin{cases}…\end{cases}

示例:

$$
f(x)=
\begin{cases}
\cfrac n2, & if\ n\ is\ even\\
\cfrac n2 + 1, & if\ n\ is\ odd
\end{cases}
$$

效果展示:
f ( x ) = { n 2 , i f   n   i s   e v e n n 2 + 1 , i f   n   i s   o d d f(x)= \begin{cases} \cfrac n2, & if\ n\ is\ even\\ \cfrac n2 + 1, & if\ n\ is\ odd \end{cases} f(x)= 2n,2n+1,if n is evenif n is odd
其中,\cfrac 增加垂直间距,& 指示对齐分类条件,\ 为条件中的空格。

方程组表达式

基本语法

\begin{array}...\end{array}\left \{ \right.组合使用。

示例:

$$
\left \{ 
\begin{array}{c}
a_1x+b_1y+c_1z=d_1 \\ 
a_2x+b_2y+c_2z=d_2 \\ 
a_3x+b_3y+c_3z=d_3
\end{array}
\right.
$$

{ a 1 x + b 1 y + c 1 z = d 1 a 2 x + b 2 y + c 2 z = d 2 a 3 x + b 3 y + c 3 z = d 3 \left \{ \begin{array}{c} a_1x+b_1y+c_1z=d_1 \\ a_2x+b_2y+c_2z=d_2 \\ a_3x+b_3y+c_3z=d_3 \end{array} \right. a1x+b1y+c1z=d1a2x+b2y+c2z=d2a3x+b3y+c3z=d3

特殊符号

代码 效果
\lt, \gt, \le, \ge, \neq,\not\lt <   >   ≤   ≥   ≠ , ≮ \lt\, \gt\, \le\, \ge\, \neq,\not\lt <>=,<
\times, \div, \pm, \mp ×   ÷   ±   ∓ \times\, \div\, \pm\, \mp ×÷±
\cup, \cap, \setminus, \subset, \subseteq ,\subsetneq ,\supset, \in, \notin, \emptyset, \varnothing ∪   ∩   ∖   ⊂   ⊆   ⊊   ⊃   ∈   ∉   ∅   ∅ \cup\, \cap\, \setminus\, \subset\, \subseteq \,\subsetneq \,\supset\, \in\, \notin\, \emptyset\, \varnothing /
\to, \rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \mapsto →   →   ←   ⇒   ⇐   ↦ \to\, \rightarrow\, \leftarrow\, \Rightarrow\, \Leftarrow\, \mapsto
\land, \lor, \lnot, \forall, \exists, \top, \bot, \vdash, \vDash ∧   ∨   ¬   ∀   ∃   ⊤   ⊥   ⊢   ⊨ \land\, \lor\, \lnot\, \forall\, \exists\, \top\, \bot\, \vdash\, \vDash ¬
\star, \ast, \oplus, \circ, \bullet ⋆   ∗   ⊕   ∘   ∙ \star\, \ast\, \oplus\, \circ\, \bullet
\approx, \sim , \simeq, \cong, \equiv, \prec, \lhd ≈   ∼   ≃   ≅   ≡   ≺ , ⊲ \approx\, \sim \, \simeq\, \cong\, \equiv\, \prec, \lhd ,
\hat x x ^ \hat x x^
\widehat{xy} x y ^ \widehat{xy} xy
\bar x x ˉ \bar x xˉ
\overline{xyz} x y z ‾ \overline{xyz} xyz
\vec x x ⃗ \vec x x
\overrightarrow{xy} x y → \overrightarrow{xy} xy
\dot x^2 x ˙ 2 \dot x^2 x˙2
\ddot x x ¨ \ddot x x¨

极限和三角

极限(利用上面特殊符号中的箭头符号):\lim_{x\to 0} 效果:$\lim_{x\to 0} $

三角(直接加\):\sin \theta 效果: sin ⁡ θ \sin \theta sinθ

矩阵

基本语法

\begin{matrix}…\end{matrix}

$$
\begin{matrix}
1 & 1 & 1 \\
x & y & z \\
x^2 & y^2 & z^2 \\
\end{matrix}
$$

1 1 1 x y z x 2 y 2 z 2 \begin{matrix} 1 & 1 & 1 \\ x & y & z \\ x^2 & y^2 & z^2 \\ \end{matrix} 1xx21yy21zz2

矩阵中的括号

示例代码:

(1)\begin{pmatrix} 1 & 2 \\ 3 & 4 \\ \end{pmatrix}
(2)\begin{bmatrix}1 & 2 \\ 3 & 4\\ \end{bmatrix}
(3)\begin{Bmatrix}1 & 2 \\ 3 & 4\\ \end{Bmatrix}
(4)\begin{vmatrix}1 & 2 \\ 3 & 4\\ \end{vmatrix}
(5)\begin{Vmatrix}1 & 2 \\ 3 & 4\\ \end{Vmatrix}

示例效果:
(1) ( 1 2 3 4 ) \begin{pmatrix} 1 & 2 \\ 3 & 4 \\ \end{pmatrix} (1324) - - - 》pmatrix

(2) [ 1 2 3 4 ] \begin{bmatrix}1 & 2 \\ 3 & 4\\ \end{bmatrix} [1324] - - - 》bmatrix

(3) { 1 2 3 4 } \begin{Bmatrix}1 & 2 \\ 3 & 4\\ \end{Bmatrix} { 1324} - - - 》Bmatrix

(4) ∣ 1 2 3 4 ∣ \begin{vmatrix}1 & 2 \\ 3 & 4\\ \end{vmatrix} 1324 - - - 》vmatrix

(5) ∥ 1 2 3 4 ∥ \begin{Vmatrix}1 & 2 \\ 3 & 4\\ \end{Vmatrix} 1324 - - - 》Vmatrix

矩阵中的省略

基本语法

\cdots ⋯ \cdots

\ddots ⋱ \ddots

\vdots ⋮ \vdots

$$
\begin{pmatrix}
1&1&1&\cdots&1\\
a_1&a_2&a_3&\cdots&a_m\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
a_1^n&a_2^n&a_3^n&\cdots&a_m^n\\
\end{pmatrix}
$$

( 1 1 1 ⋯ 1 a 1 a 2 a 3 ⋯ a m ⋮ ⋮ ⋮ ⋱ ⋮ a 1 n a 2 n a 3 n ⋯ a m n ) \begin{pmatrix} 1&1&1&\cdots&1\\ a_1&a_2&a_3&\cdots&a_m\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ a_1^n&a_2^n&a_3^n&\cdots&a_m^n\\ \end{pmatrix} 1a1a1n1a2a2n1a3a3n1amamn

相关推荐

  1. markdown公式编写备忘录

    2024-01-22 07:12:01       54 阅读
  2. vscode编写markdown

    2024-01-22 07:12:01       67 阅读
  3. vscode中编写Markdown

    2024-01-22 07:12:01       36 阅读
  4. VSCode 写Markdown数学公式,随时补充

    2024-01-22 07:12:01       40 阅读
  5. 突破编程_C++_设计模式(备忘录模式)

    2024-01-22 07:12:01       36 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-22 07:12:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-22 07:12:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-01-22 07:12:01       82 阅读
  4. Python语言-面向对象

    2024-01-22 07:12:01       91 阅读

热门阅读

  1. Effective Objective-C 学习第二周

    2024-01-22 07:12:01       44 阅读
  2. Docker compose部署Golang服务

    2024-01-22 07:12:01       53 阅读
  3. docker常用命令总结

    2024-01-22 07:12:01       52 阅读
  4. 几种排序算法

    2024-01-22 07:12:01       51 阅读
  5. briefly describe the classic sorting algorithm

    2024-01-22 07:12:01       48 阅读
  6. 【python学习】面向对象编程1

    2024-01-22 07:12:01       50 阅读