📐 Math Plugin

Insert and render LaTeX math equations

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:

  1. Inline: $formula$ for inline equations
  2. Display: $$formula$$ for display equations
  3. Labeled: Add equation numbers and references
  4. 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