Mathematical Formulas
About 479 wordsAbout 2 min
2025-11-29
Overview
The theme has built-in support for mathematical formulas.
This feature is powered by @vuepress/plugin-markdown-math. You can choose to render mathematical formulas in markdown using the following methods:
katex(default)mathjax
Usage
export default defineUserConfig({
theme: plumeTheme({
markdown: {
math: {
type: 'katex', // 'katex' | 'mathjax'
// ... Other configuration options
}
},
})
})When you choose to use mathjax, you also need to install the dependency by running the following command:
pnpm add @mathjax/srcyarn add @mathjax/srcnpm i @mathjax/srcSyntax
Inline Syntax
Use $ to wrap mathematical formulas (i.e., write the mathematical formula between two $ symbols)
Euler's identity eiπ+1=0 is a beautiful formula in R2.
Inline Mode
Euler's identity $e^{i\pi}+1=0$ is a beautiful formula in $\mathbb{R}^2$.Block Syntax
Use $$ to wrap mathematical formulas (i.e., write the mathematical formula between two $$ symbols)
<!-- Write the mathematical formula between two `$$` symbols, rendered in a separate block -->
$$xxx$$
<!-- The two `$$` symbols can each occupy a separate line, with the mathematical formula between them -->
$$
xxx
$$∂ωr∂r(ωyω)=(ωyω){(logy)r+i=1∑rωi(−1)Ir⋯(r−i+1)(logy)ri}
Block Mode
$$
\frac {\partial^r} {\partial \omega^r} \left(\frac {y^{\omega}} {\omega}\right)
= \left(\frac {y^{\omega}} {\omega}\right) \left\{(\log y)^r + \sum_{i=1}^r \frac {(-1)^ Ir \cdots (r-i+1) (\log y)^{ri}} {\omega^i} \right\}
$$Related Tutorials
TeX
KaTeX
KaTeX Supported FeaturesKaTeX Support Table
MathJax
Supported TeX / KaTeX Commands
Configuration Options
type'katex' | 'mathjax'
'katex'
delimitersOptional'brackets' | 'dollars' | 'all'
'dollars'
Enabled math delimiter syntax.
"brackets": Use\(...\)for inline math and\[...\]for display mode math (LaTeX style)"dollars": Use$...$for inline math and$$...$$for display mode math (common Markdown style)"all": Enable both bracket and dollar sign syntax
Using KaTeX
When using KaTeX, any other options will be passed to KaTeX as KatexOptions. For all available options, refer to the KaTeX documentation.
Additionally, 2 special options are supported:
copyOptionalboolean
false
Whether to enable the copy extension.
mhchemOptionalboolean
false
Whether to enable the mhchem extension.
Using MathJax
When using MathJax, you can set:
texOptionalobject
Options passed to the TeX input parser.
outputOptional'svg' | 'chtml'
'svg'
Output format, either SVG or Common HTML.
chtmlOptionalobject
Options passed to the Common HTML output parser.
svgOptionalobject
Options passed to the SVG output parser.
