This MathJax wrapper converts TeX to Scalable Vector Graphics (SVG). This package doesn't use any webworkers, webviews ; so It can be used for your NodeJS, React and React Native projects.
npm install tex-to-svg --save
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 = TeXToSVG(myTeXEquation, options); // returns <svg style="vertical-align: -2.172ex" xmlns="http://www.w3.org/2000/svg" width="18.199ex" height="5.451ex" role="img" focusable="false" viewBox="0 -1449.5 8044 2409.5" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path ...
import TeXToSVG from "tex-to-svg";
const myTeXEquation = "\\frac{n!}{k!(n-k)!} = \\binom{n}{k}";
const SVGEquation = TeXToSVG(myTeXEquation); // returns <svg style="vertical-align: -2.172ex" xmlns="http://www.w3.org/2000/svg" width="18.199ex" height="5.451ex" role="img" focusable="false" viewBox="0 -1449.5 8044 2409.5" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path ...
TeXToSVG(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
?: = optional parameter
This wrapper comes from this project : https://github.com/mathjax/MathJax-demos-node/tree/master/direct.
You DON'T have to install any types @types/tex-to-svg
.