MCPInstall

slidev-latex

Render mathematical formulas with LaTeX/KaTeX in Slidev. Use this skill for equations, mathematical notation, and scientific content.

Installs
217
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/yoanbernabeu/slidev-skills --skill slidev-latex
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads slidev-latex automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

LaTeX/KaTeX in Slidev

This skill covers rendering mathematical formulas and scientific notation in Slidev using KaTeX, a fast LaTeX math rendering library.

When to Use This Skill

  • Writing mathematical equations
  • Scientific presentations
  • Technical documentation
  • Academic content
  • Physics, chemistry, or engineering formulas

Basic Syntax

Inline Math

Surround with single $:

The quadratic formula is $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$ where $a \neq 0$.

Block Math

Surround with double $$:

$$
E = mc^2
$$

Or with line breaks:

$$
\begin{aligned}
f(x) &= x^2 + 2x + 1 \\
     &= (x + 1)^2
\end{aligned}
$$

Common Mathematical Notations

Fractions

Simple: $\frac{a}{b}$

Nested: $\frac{1}{\frac{a}{b} + c}$

Display: $$\frac{x^2 + y^2}{z}$$

Exponents and Subscripts

Exponent: $x^2$, $e^{i\pi}$
Subscript: $x_1$, $a_{ij}$
Combined: $x_1^2$, $a_{ij}^{n+1}$

Square Roots

Simple: $\sqrt{x}$
N-th root: $\sqrt[n]{x}$
Complex: $\sqrt{x^2 + y^2}$

Greek Letters

Lowercase: $\alpha$, $\beta$, $\gamma$, $\delta$, $\epsilon$, $\theta$, $\lambda$, $\mu$, $\pi$, $\sigma$, $\omega$

Uppercase: $\Gamma$, $\Delta$, $\Theta$, $\Lambda$, $\Pi$, $\Sigma$, $\Omega$

Operators

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)$

Equations and Formulas

Famous Equations

$$
\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
$$

Systems of Equations

$$
\begin{cases}
x + y = 10 \\
2x - y = 5
\end{cases}
$$

Aligned Equations

$$
\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}
$$

Matrices

$$
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
$$

Mathematical Symbols

Comparison

$<$, $>$, $\leq$, $\geq$, $\neq$, $\approx$, $\equiv$, $\sim$

Logic

$\forall$ (for all), $\exists$ (exists), $\neg$ (not)
$\land$ (and), $\lor$ (or), $\Rightarrow$ (implies)

Sets

$\in$ (in), $\notin$ (not in), $\subset$, $\subseteq$
$\cup$ (union), $\cap$ (intersection)
$\emptyset$ (empty set), $\mathbb{R}$ (reals), $\mathbb{N}$ (naturals)

Calculus

$\frac{dy}{dx}$, $\frac{\partial f}{\partial x}$
$\nabla f$, $\nabla \cdot F$, $\nabla \times F$

Arrows

$\rightarrow$, $\leftarrow$, $\leftrightarrow$
$\Rightarrow$, $\Leftarrow$, $\Leftrightarrow$
$\mapsto$, $\to$

Advanced Features

Line Highlighting in Math

$$ {1|3|all}
\begin{aligned}
f(x) &= x^2 \\      // Click 1
f'(x) &= 2x \\      // Click 1
f''(x) &= 2         // Click 2
\end{aligned}
$$

Custom Colors

$$
{\color{red} x^2} + {\color{blue} y^2} = {\color{green} z^2}
$$

Boxed Formulas

$$
\boxed{E = mc^2}
$$

Text in Math

$$
f(x) = \begin{cases}
x & \text{if } x \geq 0 \\
-x & \text{otherwise}
\end{cases}
$$

Chemistry Formulas

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-}$$

Physics Formulas

Mechanics

$$
F = ma \quad \text{(Newton's Second Law)}
$$

$$
W = \int_a^b \vec{F} \cdot d\vec{s}
$$

$$
KE = \frac{1}{2}mv^2
$$

Electromagnetism

$$
\vec{F} = q(\vec{E} + \vec{v} \times \vec{B})
$$

$$
\nabla \cdot \vec{E} = \frac{\rho}{\epsilon_0}
$$

Quantum Mechanics

$$
\hat{p} = -i\hbar\frac{\partial}{\partial x}
$$

$$
\Delta x \cdot \Delta p \geq \frac{\hbar}{2}
$$

Statistics

$$
\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)}
$$

Machine Learning

$$
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)
$$

Best Practices

1. Keep Formulas Readable

❌ 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}$

2. Use Display Mode for Complex Formulas

❌ 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}$$

3. Add Context

**Theorem**: For any triangle with sides $a$, $b$, $c$:

$$a^2 + b^2 = c^2$$

*where $c$ is the hypotenuse.*

4. Use Aligned for Multi-Step

$$
\begin{aligned}
\text{Given: } & x + y = 5 \\
\text{And: } & x - y = 1 \\
\text{Adding: } & 2x = 6 \\
\text{Therefore: } & x = 3, y = 2
\end{aligned}
$$

Common Mistakes

❌ Missing escape for special characters

$50%$ (error!)

✓ Escaped correctly

$50\%$

❌ Missing braces for multi-character

$x^10$ (shows x¹0)

✓ With braces

$x^{10}$

Output Format

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}
$$

FAQ

What does the slidev-latex skill do?

Render mathematical formulas with LaTeX/KaTeX in Slidev. Use this skill for equations, mathematical notation, and scientific content.

How do I install slidev-latex?

Run npx skills add https://github.com/yoanbernabeu/slidev-skills --skill slidev-latex in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/slidev-latex/ (personal) or .claude/skills/slidev-latex/ (project).

Which AI agents can use slidev-latex?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is slidev-latex safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains slidev-latex?

It is published by yoanbernabeu in yoanbernabeu/slidev-skills. It has 217 recorded installs.

More from yoanbernabeu/slidev-skills

View all →

slidev-styling

yoanbernabeu/slidev-skills

Style Slidev slides with UnoCSS and custom CSS. Use this skill for custom colors, typography, animations, and responsive designs.

Frontend & Design307 installs

slidev-quick-start

yoanbernabeu/slidev-skills

Get started with Slidev presentations in minutes. Use this skill to create your first presentation or set up a new Slidev project.

Docs & Writing299 installs

slidev-themes

yoanbernabeu/slidev-skills

Use and customize Slidev themes. Use this skill to apply themes, configure theme options, and create custom themes.

Frontend & Design297 installs

slidev-syntax-guide

yoanbernabeu/slidev-skills

Master Slidev's extended Markdown syntax. Use this skill to write slides with advanced formatting, frontmatter, and special features.

Docs & Writing279 installs

slidev-drawings

yoanbernabeu/slidev-skills

Draw and annotate during Slidev presentations. Use this skill for live annotations, highlighting, and visual explanations.

253 installs

slidev-project-structure

yoanbernabeu/slidev-skills

Understand Slidev project structure and configuration. Use this skill to configure themes, addons, and customize your presentation setup.

Docs & Writing248 installs

Popular education & science skills

View category →

teach

mattpocock/skills

Teach the user a new skill or concept, within this workspace.

Education & Science874K installs

scaffold-exercises

mattpocock/skills

Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.

Education & Science488.2K installs

paper-context-resolver

lllllllama/rigorpilot-skills

Rigor Paper Context helper for README-first deep learning repo reproduction. Use only when the README and repository files leave a narrow reproduction-critical gap and the task is to resolve a specific paper detail such as dataset split, preprocessing, evaluation protocol, checkpoint mapping, or runtime assumption from primary paper sources while recording conflicts. Do not use for general paper summary, repo scanning, environment setup, command execution, title-only paper lookup, or replacing README guidance by default.

Education & Science478.3K installs

caveman-learn

juliusbrussee/caveman

Act on a Caveman learn report - review the ranked token sinks, apply cost-lowering fixes with per-edit consent, and report what those fixes returned. Use when asked to lower an agent's token cost, what caveman has saved, to trim a heavy CLAUDE.md, or to offload re-pasted context into cavemem.

Education & Science107.9K installs

gsap-plugins

greensock/gsap-skills

Official GSAP skill for GSAP plugins — registration, ScrollToPlugin, ScrollSmoother, Flip, Draggable, Inertia, Observer, SplitText, ScrambleText, SVG and physics plugins, CustomEase, EasePack, CustomWiggle, CustomBounce, GSDevTools. Use when the user asks about a GSAP plugin, scroll-to, flip animations, draggable, SVG drawing, or plugin registration.

Education & Science67.9K installs

teach-impeccable

pbakaus/impeccable

DEPRECATED: Use /impeccable teach instead. This command has been folded into the impeccable skill.