node package manager



Markdown-it plugin to include ascii-math.

Code block

Example input:

    varphi = int_0^10 x^2 dx

Output: HTML, renders to:

math output

Inline math

Example input:

    Test `1+1=2` or ``2+2=4``. Optional: `math 3+3=6`.


markdown-it-asciimath converts ASCII-math to TeX and then uses KaTeX to render the math. The ASCII-math - TeX conversion is done using the ASCIIMathML Scripts. The following file needs to be included:

<script src="./node_modules/markdown-it-asciimath/ASCIIMathTeXImg.js"></script>

The plugin uses KaTeX to render TeX-math so the KaTeX stylesheet needs to be included:

<link rel="stylesheet" href="">

To use the plugin:

var md = require('markdown-it')();

LaTeX math code can be rendered, too. Just use the keyword latex instead of math.


Options can be specified:

md.use(require("markdown-it-asciimath"), options);

Now only this option is available:

Name Description Default
"useKeyword" Use the keywords math and latex to specify inline math syntax false