TeX to SVG


texsvg is an npm package that converts TeX to SVG:

$ npm install texsvg

It can be used as a module:

const texsvg = require('texsvg');
const tex = '\\frac{a}{b}';
texsvg(tex).then(svg => console.log(svg));

Or as a CLI command:

# texsvg <tex> <file>
$ npx texsvg '\frac{a}{b}' fraction.svg

It’s built with:

This library was used to build texsvg-server, which is a web API for converting TeX to SVG.

Quadratic formula example:

x equals begin fraction negative b plus or minus begin square root b squared minus 4 times a times c end square root over 2 times a end fraction

JSFiddle demo:

Check out the GitHub repository. Pull requests are welcome!



If you enjoyed this post, please consider supporting this site!