This code mainly tries to turn LaTeX into SVG/PNG, with the intention of running a Telegram bot.
In particular diagrams would be nice to draw, but...
- While the
amscdpackage is supported, thetikzpackage is not - MathJax itself probably won't ever support
tikz(#41). - This is based on
mathjax-full
Uses mathjax and svg2img to render LaTeX or (TBD) ASCIIMath into an SVG or PNG image.
Example:
let mathrender = require('mathrender')
// input document
let latex = 'F : \\mathcal(C) \\to \\mathcal(C)'
let svg = mathrender.latexToSVG(latex) // string
let png = mathrender.latexToPNG(latex) // Buffer
// write to filesystem
require('fs').writeFileSync('output.png', png)- enabled support for ASCII Math ?
- use this? https://github.com/mathjax/MathJax-node
- check this https://github.com/pkra/mathjax-node-svg2png
- which uses this https://www.npmjs.com/package/svg2png
- Tikz compiled to WebAssembly tikzjax.com
- MathJax issues about tikz #2156, #41