Files
obsidian-vault/06 平台与配置/LaTeX 语法.md
2026-06-23 00:24:32 +08:00

186 lines
4.5 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

```
目前已经准备开始研究生阶段的学习了
同时自己有志于在量化交易上精进
因此对于数学公式的表达就有了学习的要求和需求用这篇笔记记录一下LateX语法。
```
$$E=mc^2$$
----
以下是 LaTeX 数学公式的核心语法整理,覆盖公式结构、符号、排版技巧及复杂表达式写法,按功能分类陈列:
---
### 一、**公式基础语法**
1. **行内公式与块级公式**
- 行内公式:用单美元符号包裹,如 `$E=mc^2$`  E=mc2E=mc2
- 块级公式:用双美元符号或 `$$...$$` 包裹,如
latex
latex
复制
```latex
$$ \sum_{i=1}^n i = \frac{n(n+1)}{2} $$
```
显示为独立居中公式。
---
### 二、**数学符号与基本结构**
2. **上下标与分式**
- 上标:`x^2`  x2x2下标`a_i`  aiai组合`x_i^{n+1}`  xin+1xin+1
- 分式:`\frac{a}{b}`  abba嵌套分式`\frac{\frac{x}{y}}{z}`  xyzzyx
3. **根号与括号**
- 平方根:`\sqrt{x}`  xxn次根`\sqrt[3]{x}`  x33x
- 自动缩放括号:`\left( \frac{a}{b} \right)` → (ab)(ba)。
4. **希腊字母与运算符**
- 小写字母:`\alpha`, `\beta` → α, β
- 大写字母:`\Gamma`, `\Delta` → Γ, Δ
- 运算符:`\times`(×)、`\cdot`(·)、`\div`(÷)。
---
### 三、**复杂公式结构**
5. **求和、积分与极限**
- 求和:`\sum_{i=1}^n`  ∑i=1n∑i=1n
- 积分:`\int_a^b f(x)\,dx`  ∫abf(x)dx∫abf(x)dx
- 极限:`\lim_{x \to 0} \frac{\sin x}{x}`  limx→0sinxxlimx→0xsinx
6. **矩阵与方程组**
- 基础矩阵:
latex
latex
复制
```latex
\begin{matrix} a & b \\ c & d \end{matrix} → \begin{matrix} a & b \\ c & d \end{matrix}
```
- 带括号矩阵:
latex
latex
复制
```latex
\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} → \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}
```
- 分段函数:
latex
latex
复制
````latex
f(x) = \begin{cases} x^2 & x \geq 0 \\ -x & x < 0 \end{cases} → f(x) = \begin{cases} x^2 & x \geq 0 \\ -x & x < 0 \end{cases}
```。
````
---
### 四、**多行公式与对齐**
7. **多行公式环境**
- `align` 环境对齐多行公式:
latex
latex
复制
```latex
\begin{align}
x &= y + z \\
a &= b \times c
\end{align}
```
每行用 `&` 对齐符号,`\\` 换行
- `split` 环境(需嵌套在 `equation` 中):
latex
latex
复制
````latex
\begin{equation}
\begin{split}
a &= b \\
&= c + d
\end{split}
\end{equation}
```。
````
---
### 五、**高级技巧**
8. **公式编号与引用**
- 自动编号:使用 `equation` 环境
latex
latex
复制
```latex
\begin{equation}
e^{i\pi} + 1 = 0
\end{equation}
```
生成带编号公式
- 引用公式:`\label{eq:1}` 和 `\eqref{eq:1}`。
9. **特殊字体与符号**
- 黑板粗体:`\mathbb{R}`  RR实数集
- 向量箭头:`\vec{v}`  v⃗v。
---
### 六、**常用符号速查表**
|类型|语法示例|效果|
|---|---|---|
|求和|`\sum_{i=1}^n`|∑i=1n∑i=1n|
|积分|`\int_0^\infty`|∫0∞∫0∞|
|不等式|`a \leq b`|a≤ba≤b|
|逻辑符号|`A \subset B`|A⊂BA⊂B|
|导数|`\frac{dy}{dx}`|dydxdxdy|
---
### 附:学习建议
- **实践工具**推荐使用 Overleaf 在线编辑器实时预览公式效果
- **扩展学习**​:若需排版论文级公式(如定理、引理),可参考 `amsthm` 宏包。
如需更完整的符号列表(如箭头、集合符号)或特定场景的写法(如化学式、流程图),可查阅上述来源中的详细章节。