The MathJax wrapper to convert TeX to SVG
npm install tex-to-svgcli
npm install tex-to-svg --save
`
Examples
$3
`js
const TeXToSVG = require("tex-to-svg");
const myTeXEquation = "\\frac{n!}{k!(n-k)!} = \\binom{n}{k}";
const options = {
width: 1280,
ex: 8,
em: 16
};
const SVGEquation = MMLToSVG(myTeXEquation, options); // returns `
$3
`ts
import TeXToSVG from "tex-to-svg";
const myTeXEquation = "\\frac{n!}{k!(n-k)!} = \\binom{n}{k}";
const SVGEquation = MMLToSVG(myTeXEquation); // returns `
Documentation
MMLToSVG(equation, options) : string _The returned Scalable Vector Graphics equation_
> equation : string _The TeX equation_
>
> options ?: object _The options of the retuned Scalable Vector Graphics_
>
> > width ?: number _The width of container in pixels_
> >
> > ex ?: number _The ex-size in pixels_
> >
> > em ?: number _The em-size in pixels_
$3
?: = optional parameter
Notes
$3
This wrapper is inspired by this project : https://github.com/mathjax/MathJax-demos-node/tree/master/direct.
$3
You DON'T have to install any types @types/tex-to-svg`.