Hi,
I’ve been down several rabbit holes trying to figure out how to do this most naturally.
For example dash-latex
. Had an issue.
PyLaTeX
heavy reliance on ActiveState, and wouldn’t run client-side. And it’s broken. I installed perl etc and it still doesn’t work.
Our best bet is still MathJax!
Has anyone got this to work? I am able to render mathjax to SVG with:
<html>
<header>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=default"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js"],
jax: ["input/TeX", "output/SVG"],
})
</script>
</header>
<body>
<svg width="1960" height="1080" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<div>$$a = b + c$$</div>
</svg>
</body>
</html>
It fills out the SVG in place. But you can’t view it with “View source” in your browser. “Inspect” works in chrome.
Just wondering how then to tie this SVG element to a node label.
Also, how do I include MathJax.js locally or remotely into a Dash app header?
The documentations have an /assets/ folder with a custom-script.js
that somehow magically loads itself.
However, copying the entire MathJax/ folder hierarchy into /assets/ does not seem like a good idea intuitively.
Then, also, how would connect to a remote MathJax CDN like the one in the static html above?