search

Math Plugin

The Math plugin renders mathematical formulas in your Typemill content. You can write LaTeX-style math and display it beautifully with either KaTeX or MathJax.

screenshot of math formulas

Write Math with Markdown

The markdown syntax does not support math by default. Typemill implements the LaTeX and TeX syntax. Other CMS or tools for markdown might use a different syntax or might not support math at all.

You can write the syntax manually with the raw mode of the Typemill editor or you can use the visual mode, that wraps your math automatically.

Features

Requirements

Installation

  1. Download the plugin.
  2. Unzip the content.
  3. Upload the folder math to your Typemill plugins directory plugins.
  4. The final path should be your-typemill-installation/plugins/math.

Configuration

  1. Log in to your Typemill administration dashboard.
  2. Go to System -> Plugins.
  3. Activate the Math plugin.
  4. Click on Settings for the Math plugin.
  5. Choose your tool:
    • None: Math rendering is disabled.
    • KaTeX: Uses the bundled KaTeX library for fast local rendering.
    • MathJax: Loads MathJax from a CDN for extended LaTeX support.
  6. Save the settings.

Usage

Display Math

Display math is rendered as a centered block. You can start a math block in the editor with the math component, or write the delimiters directly in your Markdown.

\[
E = mc^2
\]

Inline Math

Inline math is rendered inside a paragraph. Both KaTeX and MathJax scan the page for inline delimiters.

Supported inline math syntax:

The energy is \( E = mc^2 \) in this frame.

Export Support (Planned)

Static exports, PDFs, and EPUBs require math to be rendered as self-contained images because the client-side JavaScript engines are not available during export. The plugin code already listens to Typemill's onExportHtmlLoaded event and will, in a future version, replace browser-rendered formulas with cached SVG images when a remote render endpoint is configured.

Expected render endpoint contract:

POST /math
{
  "math": "E = mc^2",
  "display_mode": true,
  "tool": "katex"
}

Response: SVG string.

Third-Party Libraries

This plugin includes the following third-party libraries:

KaTeX

MathJax

Changelog

Version 2.1.0

Version 2.0.1

Version 2.0.0