Math support in Markdown
aka: LaTeX, KaTeX, MathJAX
Installation
-
Install dependencies
Terminal window pnpm add starlight-katex -
Configure Astro
astro.config.mjs import { starlightKatex } from "starlight-katex";export default defineConfig({integrations: [starlight({plugins: [starlightKatex()],}),],});
Example
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}$$
When , there are two solutions to and they are