Skip to content
Math

Math

Posted Updated
By 廿四2 min Read

Adds TEX support in your VitePress site.

Settings

Install related TEX package markdown-it-mathjax3 in your project:

bash
$ pnpm add -D markdown-it-mathjax3
bash
$ npm add -D markdown-it-mathjax3
bash
$ yarn add -D markdown-it-mathjax3
bash
$ bun add -D markdown-it-mathjax3

Then enabling via:

.vitepress/config.ts
ts
import { defineConfig } from 'vitepress-theme-niansi'

export default defineConfig({
  markdown: {
    math: true,
  }
})

Demo

When a0, there are two solutions to (ax2+bx+c=0) and they are

x=b±b24ac2a
Demo
md
When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$

Changelog

2026-04-18 23:33
View All Changelog