A Vue component for LaTeX expression rendering using KaTeX. More information in Katex Vue
- 🔧 Configurable global defaults
- 📦 Supports both SSR and CSR
- ⚡️ Optimized rendering performance
- 🔄 Reactive expression updates
Using npm
$ npm add -D katex katex-vueUsing pnpm
$ pnpm add -D katex katex-vueUsing yarn
$ yarn add -D katex katex-vueUsing bun
$ bun add -D katex katex-vueimport {createApp} from 'vue'
import KatexVue from 'katex-vue'
const app = createApp()
app.use(KatexVue, {
// your global default config
displayMode: true,
errorColor: '#ff5500'
})<script setup>
import {KatexVue} from 'katex-vue'
const expression = "\\int_0^\\infty x^2 \\mathrm{d} x"
</script>
<template>
<katex-vue :expression="expression" displayMode/>
</template>| Prop | Type | Default |
|---|---|---|
expression |
String (Required) | - |
displayMode |
Boolean | false |
output |
'mathml' / 'html' / 'htmlAndMathml' |
'htmlAndMathml' |
leqno |
Boolean | false |
fleqn |
Boolean | false |
throwOnError |
Boolean | false |
errorColor |
String | '#cc0000' |
macros |
Object | - |
minRuleThickness |
Number | - |
colorIsTextColor |
Boolean | false |
maxSize |
Number | Infinity |
maxExpand |
Number | 1000 |
strict |
Boolean / 'warn' / 'error' / 'ignore' / Function |
'warn' |
trust |
Boolean | false |
globalGroup |
Boolean | false |
Priority: Component props > Global config > Default values
Check on KaTeX Document
MIT © 2025 Infoc