MathJax in Go (GoJax?) #707
RPGillespie6
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This project is awesome. We were looking to reduce/eliminate our dependency on Node.js in order to minimize our go-based web application's SBOM/CVE surface area. However, latex rendering was a thorny issue that was tricky to get around. We currently use MathJax with Node.js for rendering latex to svg (the go application invokes node). First we tried switching to go-latex, but unfortunately it was not mature enough (and seems abandoned). So we tried running MathJax directly in a goja VM, and with a few adaptors to mock some DOM-related stuff, it worked perfectly!
Best of all, no discernible performance impact when generating svgs from latex.
In case it helps anyone else, here's a MathJax bundle file template you can use to load into goja:
Build with:
You can then add this to your go:
And now your go code can render latex by directly running MathJax in a goja VM!
Thanks again for this project!
Beta Was this translation helpful? Give feedback.
All reactions