MathJax tex2svg doesn't render directly to SVG

98 Views Asked by At

This will probably come across as a fast question without research, but I've been off-track for hours trying to figure it out.

I lately tried MathJax for the first time and I made a textarea that converted the text to an svg dynamically. Then I would save the svg and use it in other places. I used tex2svg. I remember it well. Now I tried to reuse it to render the svg to a canvas, which itself is easy, but now all I can get is a weird <mjx-container> element instead of paths. Documentation is much less than enough to cover this library and I can't find any way to get back a pure <svg> element. Please help me.

I know that you can still render the image from the <math> element under <mjx-container>><mjx-assistive-mml>, but in my case, loading into an HTMLImageElement with data:image/svg+xml will put the image in a broken state, so that's a last resort.

0

There are 0 best solutions below