The Math plugin adds native LaTeX and KaTeX support to your docmd sites.

It uses markdown-it-texmath integrated with the katex computation engine. This renders inline and block-level equations smoothly without complex client-side javascript libraries.

Configuration

The Math plugin is an optional plugin. Install it via the CLI:

npx @docmd/core add math

Enable it in your docmd.config.json:

Example

{
  "plugins": {
    "math": {}
  }
}

How It Works

  1. Enable the plugin via your docmd.config.json.
  2. Wrap your standard LaTeX mathematics in $ (inline) or $$ (block) indicators.
  3. The engine processes these rules during the build exactly as raw static HTML tags.
  4. Minimal injected CSS styles the classes automatically. This yields immediate visualisation on page load.

Usage

Inline Mathematics

Inject standard equations within a paragraph using single dollar signs $:

Here is an inline equation: $E = mc^2$

Here is an inline equation: E=mc2E = mc^2

Block Mathematics

For wider mathematical proofs or distinct formulations, use double dollar signs $$ for block level formatting:

$$
\sum_{i=1}^n i^2 = \frac{n(n+1)(2n+1)}{6}
$$
i=1ni2=n(n+1)(2n+1)6 \sum_{i=1}^n i^2 = \frac{n(n+1)(2n+1)}{6}