Closed fireflysemantics closed 3 years ago
Because backslashes are special characters in Javascript strings (so that you can get a newline with '\n'
and a tab with '\t'
), if you want a literal backslash in a Javascript string, you need to double it. So you should use
const latex = `$$MAD = \\frac{\\sum_{i=1}^n | x_i - \\bar{x} |} n$$`
instead.
AH! OK Brilliant - THANK YOU SOOOOOOO MUCH!!
No problem. Good luck!
I'm trying out the simple
textosvg
demo. This is a stackblitz of the CDN rendering of the tex:https://stackblitz.com/edit/mathjax-cdn-demo-custom-markup
This is the Latex string:
When I take that and put it in the SVG demo like this:
It produces this:
https://stackblitz.com/edit/mathjax-svg-node?file=index.html
And the output does not render properly. Any ideas?