@richhtmleditor/math
v1.1.3
Published
LaTeX / MathML equation editor plugin for Rich HTML Editor (KaTeX / MathJax adapter).
Maintainers
Readme
@richhtmleditor/math
LaTeX and MathML equation plugin for Rich HTML Editor. Adds an Insert Math toolbar tool with a formula editor and live preview rendering for inline and display math blocks. Built on @richhtmleditor/core.
Current release: 1.1.3 — Depends on @richhtmleditor/core ^1.1.3.
Repository: github.com/rajkishorsahu89/richhtmleditor
Demo: richhtmleditor.vercel.app — demo · guide · API
What's in 1.1.3
createMathPlugin— registers theinsertMathtoolbar tool- LaTeX input — type LaTeX expressions with live rendered preview
- MathML support — renders MathML for standards-compliant output
- Inline & display modes — insert equations inline or as centered display blocks
- Dark mode — math editor respects editor dark mode tokens
Community feature — no enterprise licence required.
Keywords: richhtmleditor math latex mathml equations wysiwyg
Install
npm install @richhtmleditor/math
# Requires @richhtmleditor/core (via framework wrapper or direct install).Usage
import { createEditor } from "@richhtmleditor/core";
import { createMathPlugin } from "@richhtmleditor/math";
const editor = createEditor({
element: host,
toolbar: { preset: "full" },
plugins: [createMathPlugin()]
});Angular
import { createMathPlugin } from "@richhtmleditor/math";
plugins = [createMathPlugin()];<richhtmleditor [plugins]="plugins" [toolbar]="{ preset: 'full' }" />React
import { RichHtmlEditor } from "@richhtmleditor/react";
import { createMathPlugin } from "@richhtmleditor/math";
const plugins = [createMathPlugin()];
<RichHtmlEditor toolbar={{ preset: "full" }} plugins={plugins} />API
createMathPlugin(options?)
Returns an EditorPlugin that registers the insertMath toolbar tool.
| Option | Type | Description |
| --- | --- | --- |
| defaultMode | "inline" \| "display" | Default math block mode (default: "display"). |
Related packages
@richhtmleditor/core— editor engine and plugins API.@richhtmleditor/themes— shared CSS.@richhtmleditor/diagrams— Mermaid diagrams plugin.@richhtmleditor/export— DOCX/PDF export plugin.@richhtmleditor/angular— Angular wrapper.@richhtmleditor/react— React wrapper.
