markdown-it-mathjax-svg

1.0.4 • Public • Published

markdown-it-mathjax-svg

markdown-it plugins with mathjax. Rendering mathematical formulas using the server.

The mathjax rendering service use mathjax-node

Install:

npm install markdown-it-mathjax-svg

Usage:

var config = {
    mathServiceUrl: 'http://mathServiceUrl?latex='
}

var mdmathjax = require('../index');
var markdown = require('markdown-it')()
    .use(mdmathjax, config);

var testLatex = '$$x_{ij }^2$$\n' +
    '$x_{ij }^2$\n' +
    'inline math $\\frac{1}{2}$ inline math\n';


console.log(markdown.render(testLatex))

output:
// <p><img src="http://mathServiceUrl?latex=x_%7Bij%20%7D%5E2%0A" svgimg="1"></p>
// <p><img src="http://mathServiceUrl?latex=x_%7Bij%20%7D%5E2" svgimg="1">
// inline math <img src="http://mathServiceUrl?latex=%5Cfrac%7B1%7D%7B2%7D" svgimg="1"> inline math</p>

Package Sidebar

Install

npm i markdown-it-mathjax-svg

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

23.8 kB

Total Files

6

Last publish

Collaborators

  • swimmingwhale