一键导入
slidev-latex
Render mathematical formulas with LaTeX/KaTeX in Slidev. Use this skill for equations, mathematical notation, and scientific content.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Render mathematical formulas with LaTeX/KaTeX in Slidev. Use this skill for equations, mathematical notation, and scientific content.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Master v-click and sequential animations in Slidev. Use this skill to reveal content progressively and create engaging presentations.
Add smooth slide transitions in Slidev. Use this skill for fade, slide, and custom transitions between slides.
Create beautiful code blocks with Shiki syntax highlighting. Use this skill for code snippets, line highlighting, and code groups.
Animate code transformations with Shiki Magic Move. Use this skill to create smooth morphing transitions between code states.
Add live coding with Monaco Editor in Slidev. Use this skill for interactive code demos, executable code, and real-time editing.
Leverage Vue components in Slidev slides. Use this skill to add interactivity with built-in components or create custom ones.
| name | slidev-latex |
| description | Render mathematical formulas with LaTeX/KaTeX in Slidev. Use this skill for equations, mathematical notation, and scientific content. |
This skill covers rendering mathematical formulas and scientific notation in Slidev using KaTeX, a fast LaTeX math rendering library.
Surround with single $:
The quadratic formula is $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$ where $a \neq 0$.
Surround with double $$:
$$
E = mc^2
$$
Or with line breaks:
$$
\begin{aligned}
f(x) &= x^2 + 2x + 1 \\
&= (x + 1)^2
\end{aligned}
$$
Simple: $\frac{a}{b}$
Nested: $\frac{1}{\frac{a}{b} + c}$
Display: $$\frac{x^2 + y^2}{z}$$
Exponent: $x^2$, $e^{i\pi}$
Subscript: $x_1$, $a_{ij}$
Combined: $x_1^2$, $a_{ij}^{n+1}$
Simple: $\sqrt{x}$
N-th root: $\sqrt[n]{x}$
Complex: $\sqrt{x^2 + y^2}$
Lowercase: $\alpha$, $\beta$, $\gamma$, $\delta$, $\epsilon$, $\theta$, $\lambda$, $\mu$, $\pi$, $\sigma$, $\omega$
Uppercase: $\Gamma$, $\Delta$, $\Theta$, $\Lambda$, $\Pi$, $\Sigma$, $\Omega$
Sum: $\sum_{i=1}^{n} x_i$
Product: $\prod_{i=1}^{n} x_i$
Integral: $\int_{a}^{b} f(x) \, dx$
Double integral: $\iint_D f(x,y) \, dA$
Limit: $\lim_{x \to \infty} f(x)$
$$
\text{Euler's Identity: } e^{i\pi} + 1 = 0
$$
$$
\text{Pythagorean: } a^2 + b^2 = c^2
$$
$$
\text{Einstein: } E = mc^2
$$
$$
\text{Schrödinger: } i\hbar\frac{\partial}{\partial t}\Psi = \hat{H}\Psi
$$
$$
\begin{cases}
x + y = 10 \\
2x - y = 5
\end{cases}
$$
$$
\begin{aligned}
(x + y)^2 &= x^2 + 2xy + y^2 \\
(x - y)^2 &= x^2 - 2xy + y^2 \\
(x + y)(x - y) &= x^2 - y^2
\end{aligned}
$$
$$
A = \begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
$$
$$
B = \begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{bmatrix}
$$
$$
\det(A) = \begin{vmatrix}
a & b \\
c & d
\end{vmatrix} = ad - bc
$$
$<$, $>$, $\leq$, $\geq$, $\neq$, $\approx$, $\equiv$, $\sim$
$\forall$ (for all), $\exists$ (exists), $\neg$ (not)
$\land$ (and), $\lor$ (or), $\Rightarrow$ (implies)
$\in$ (in), $\notin$ (not in), $\subset$, $\subseteq$
$\cup$ (union), $\cap$ (intersection)
$\emptyset$ (empty set), $\mathbb{R}$ (reals), $\mathbb{N}$ (naturals)
$\frac{dy}{dx}$, $\frac{\partial f}{\partial x}$
$\nabla f$, $\nabla \cdot F$, $\nabla \times F$
$\rightarrow$, $\leftarrow$, $\leftrightarrow$
$\Rightarrow$, $\Leftarrow$, $\Leftrightarrow$
$\mapsto$, $\to$
$$ {1|3|all}
\begin{aligned}
f(x) &= x^2 \\ // Click 1
f'(x) &= 2x \\ // Click 1
f''(x) &= 2 // Click 2
\end{aligned}
$$
$$
{\color{red} x^2} + {\color{blue} y^2} = {\color{green} z^2}
$$
$$
\boxed{E = mc^2}
$$
$$
f(x) = \begin{cases}
x & \text{if } x \geq 0 \\
-x & \text{otherwise}
\end{cases}
$$
Enable mhchem extension in vite.config.ts:
import 'katex/contrib/mhchem'
export default {}
Then use:
$$\ce{H2O}$$
$$\ce{2H2 + O2 -> 2H2O}$$
$$\ce{CO2 + C -> 2CO}$$
$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$
$$
F = ma \quad \text{(Newton's Second Law)}
$$
$$
W = \int_a^b \vec{F} \cdot d\vec{s}
$$
$$
KE = \frac{1}{2}mv^2
$$
$$
\vec{F} = q(\vec{E} + \vec{v} \times \vec{B})
$$
$$
\nabla \cdot \vec{E} = \frac{\rho}{\epsilon_0}
$$
$$
\hat{p} = -i\hbar\frac{\partial}{\partial x}
$$
$$
\Delta x \cdot \Delta p \geq \frac{\hbar}{2}
$$
$$
\bar{x} = \frac{1}{n}\sum_{i=1}^{n} x_i
$$
$$
\sigma^2 = \frac{1}{n}\sum_{i=1}^{n}(x_i - \bar{x})^2
$$
$$
P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}
$$
$$
J(\theta) = -\frac{1}{m}\sum_{i=1}^{m}[y^{(i)}\log(h_\theta(x^{(i)})) + (1-y^{(i)})\log(1-h_\theta(x^{(i)}))]
$$
$$
\text{softmax}(z_i) = \frac{e^{z_i}}{\sum_{j=1}^{K} e^{z_j}}
$$
$$
\nabla_\theta J(\theta) = \frac{1}{m} X^T (h_\theta(X) - y)
$$
❌ Too dense
$\frac{\frac{a}{b}+\frac{c}{d}}{\frac{e}{f}-\frac{g}{h}}$
✓ Broken into steps
Let $x = \frac{a}{b} + \frac{c}{d}$ and $y = \frac{e}{f} - \frac{g}{h}$
Then the result is $\frac{x}{y}$
❌ Complex inline
The integral $\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$ is fundamental.
✓ Display mode
The Gaussian integral:
$$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$
**Theorem**: For any triangle with sides $a$, $b$, $c$:
$$a^2 + b^2 = c^2$$
*where $c$ is the hypotenuse.*
$$
\begin{aligned}
\text{Given: } & x + y = 5 \\
\text{And: } & x - y = 1 \\
\text{Adding: } & 2x = 6 \\
\text{Therefore: } & x = 3, y = 2
\end{aligned}
$$
❌ Missing escape for special characters
$50%$ (error!)
✓ Escaped correctly
$50\%$
❌ Missing braces for multi-character
$x^10$ (shows x¹0)
✓ With braces
$x^{10}$
When creating math content:
# [Topic Title]
[Brief explanation of the concept]
**Definition/Formula:**
$$
[Main formula in display mode]
$$
**Where:**
- $[variable]$ = [meaning]
- $[variable]$ = [meaning]
**Example:**
[Step-by-step solution]
$$
\begin{aligned}
\text{Step 1: } & [equation] \\
\text{Step 2: } & [equation] \\
\text{Result: } & [final answer]
\end{aligned}
$$