Skip to content

Commit 35753f9

Browse files
committed
feat: support latex, close #16
1 parent 10bd2a1 commit 35753f9

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

guide/syntax.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,37 @@ This is the cover page.
161161
```
162162

163163
For more details about using a theme, refer to the [themes usage section](/themes/use).
164+
165+
## LaTeX
166+
167+
Slidev comes with LaTeX support out-of-box, powered by [KaTeX](https://katex.org/).
168+
169+
### Inline
170+
171+
Surround your LaTeX with a single `$` on each side for inline rendering.
172+
173+
```md
174+
$\sqrt{3x-1}+(1+x)^2$
175+
```
176+
177+
### Block
178+
179+
Use two (`$$`) for block rendering. This mode uses bigger symbols and centers
180+
the result.
181+
182+
```md
183+
$$
184+
\begin{array}{c}
185+
186+
\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} &
187+
= \frac{4\pi}{c}\vec{\mathbf{j}} \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
188+
189+
\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
190+
191+
\nabla \cdot \vec{\mathbf{B}} & = 0
192+
193+
\end{array}
194+
$$
195+
```
196+
197+
Learn more: [KaTeX](https://katex.org/) | [`markdown-it-katex`](https://github.com/waylonflinn/markdown-it-katex).

0 commit comments

Comments
 (0)