markdown-it-mathjax-svg
v1.0.4
Published
Render Mathjax for makdown-it
Downloads
3
Maintainers
Readme
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>