Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Katex-vue

A Vue component for LaTeX expression rendering using KaTeX. More information in Katex Vue

Features

  • 🔧 Configurable global defaults
  • 📦 Supports both SSR and CSR
  • ⚡️ Optimized rendering performance
  • 🔄 Reactive expression updates

Usage

Installation

Using npm

$ npm add -D katex katex-vue

Using pnpm

$ pnpm add -D katex katex-vue

Using yarn

$ yarn add -D katex katex-vue

Using bun

$ bun add -D katex katex-vue

Global Registration

import {createApp} from 'vue'
import KatexVue from 'katex-vue'

const app = createApp()
app.use(KatexVue, {
    // your global default config
    displayMode: true,
    errorColor: '#ff5500'
})

Component Usage

<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>

Configuration Options

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

Licence

MIT © 2025 Infoc

About

A Vue component for LaTeX expression rendering using KaTeX.

Resources

Stars

14 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages