You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/guide/markdown.md
+45
Original file line number
Diff line number
Diff line change
@@ -795,6 +795,51 @@ The format of the selected line range can be: `{3,}`, `{,10}`, `{1,10}`
795
795
Note that this does not throw errors if your file is not present. Hence, when using this feature make sure that the contents are being rendered as expected.
796
796
:::
797
797
798
+
## Math Equations
799
+
800
+
This is currently opt-in. To enable it, you need to install `markdown-it-mathjax3` and set `markdown.math` to `true` in your config file:
801
+
802
+
```sh
803
+
npm add -D markdown-it-mathjax3
804
+
```
805
+
806
+
```ts
807
+
// .vitepress/config.ts
808
+
exportdefault {
809
+
markdown: {
810
+
math: true
811
+
}
812
+
}
813
+
```
814
+
815
+
**Input**
816
+
817
+
```md
818
+
When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are
| $\nabla \cdot \vec{\mathbf{B}} = 0$ | divergence of $\vec{\mathbf{B}}$ is zero |
826
+
| $\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} = \vec{\mathbf{0}}$ | curl of $\vec{\mathbf{E}}$ is proportional to the rate of change of $\vec{\mathbf{B}}$ |
| $\nabla \cdot \vec{\mathbf{B}} = 0$ | divergence of $\vec{\mathbf{B}}$ is zero |
840
+
| $\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} = \vec{\mathbf{0}}$ | curl of $\vec{\mathbf{E}}$ is proportional to the rate of change of $\vec{\mathbf{B}}$ |
VitePress uses [markdown-it](https://github.com/markdown-it/markdown-it) as the Markdown renderer. A lot of the extensions above are implemented via custom plugins. You can further customize the `markdown-it` instance using the `markdown` option in `.vitepress/config.js`:
0 commit comments