Overview
The Math plugin enables insertion and rendering of mathematical equations using LaTeX syntax. Create complex mathematical formulas, scientific equations, and chemical structures with full equation editing and preview capabilities.
Features
- â LaTeX equation support
- â Equation editor
- â Real-time preview
- â MathML support
- â Equation numbering
- â Chemical formulas
- â Symbol palette
- â Export equations
Installation
npm install @editora/plugin-math
Basic Usage
import Editora from '@editora/core';
import MathPlugin from '@editora/plugin-math';
const editor = new Editora('#editor');
editor.use(MathPlugin, {
engine: 'mathjax'
});
// Insert equation
editor.execCommand('insertEquation');
Writing Equations
Create mathematical expressions:
- Inline: $formula$ for inline equations
- Display: $$formula$$ for display equations
- Labeled: Add equation numbers and references
- Aligned: Multi-line aligned equations
Configuration Options
| Option | Type | Description |
|---|---|---|
| engine | string | Math engine (mathjax, katex) |
| numbering | boolean | Enable equation numbering (default: false) |
API Methods
- insertEquation(): Insert math equation
- editEquation(): Edit selected equation
- insertSymbol(symbol): Insert math symbol
- renderEquation(latex): Render LaTeX formula