Skip to content

Markdown-it plugin to include KaTeX and AsciiMath in your documents

License

Notifications You must be signed in to change notification settings

qilin-editor/markdown-it-maths

Repository files navigation

markdown-it-maths

Greenkeeper badge Build Status npm version npm downloads

markdown-it-maths is a markdown-it plugin for processing and rendering KaTeX and AsciiMath directly into your document. It ships with all the fonts and stylesheets required for an offline usage.

Installation

$ npm install markdown-it-maths

Usage

// Create a markdown-it instance:
const md = require("markdown-it")();

// …and use maths without any configuration required!
md.use(require("markdown-it-maths"));

Syntax

Inline:

AsciiMath inline syntax:

Lorem ipsum `math a/b + c/d = e/f` dolor stuff.

KaTeX inline syntax:

Lorem ipsum `katex \frac{a}{b} + \frac{c}{d} = \frac{e}{f}` dolor stuff.

Blocks

AsciiMath block syntax:

Lorem ipsum dolor stuff:

```math
a/b + c/d = e/f
```

KaTeX block syntax:

Lorem ipsum dolor stuff:

```katex
\frac{a}{b} + \frac{c}{d} = \frac{e}{f}
```

Note: you can use the keyword latex instead of katex.

About

Markdown-it plugin to include KaTeX and AsciiMath in your documents

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published