@gerhobbelt/markdown-it-mathjax

Markdown-it plugin to bypass LaTeX math for mathjax processing

Stats

StarsIssuesVersionUpdatedCreatedSize
@gerhobbelt/markdown-it-mathjax
002.0.1-33 years ago4 years agoMinified + gzip package size for @gerhobbelt/markdown-it-mathjax in KB

Readme

markdown-it-mathjax

Build Status NPM version Coverage Status

Markdown-it plugin to bypass LaTeX math for mathjax processing.

Processes TeX displayed math

$$1 *2* 3$$ => \[1 *2* 3\]

Processes TeX in-line math

$1 *2* 3$ => \(1 *2* 3\)

Skips in-line math if numbers are around (according to pandoc math)

$1 *2* 3$5 => $1 <em>2</em> 3$5

Also processes LaTeX delimiters (double backslashed)

\\(1 *2* 3\\) => \(1 *2* 3\)

\\[1 *2* 3\\] => \[1 *2* 3\]

And sections

\begin{abc}1 *2* 3\end{abc} => \begin{abc}1 *2* 3\end{abc}

Install

npm install @gerhobbelt/markdown-it-mathjax --save

Use

var md = require('@gerhobbelt/markdown-it')()
            .use(require('@gerhobbelt/markdown-it-mathjax')());

md.render('$1 *2* 3$') // => '<p>\(1 *2* 3\)</p>'

Differences in browser. If you load script directly into the page, without package system, module will add itself globally as window.markdownitMathjax.

License

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.