5 ms·
The only JS I need on my blog is Mathjax. Is there a static site generator that can render latex equations into svg's automatically? On the one hand, I want to
by powersnail 5y ago
The only JS I need on my blog is Mathjax. Is there a static site generator that can render latex equations into svg's automatically?
On the one hand, I want to get rid of JS. On the other hand, I prefer to keep the plain text equation in my markdowns, rather than generating and linking to an image.
I feel like I'm one long weekend away from building my own SSG to do this.
- guyomes 5y agoGladTex [0] converts latex math in html files to SVG images with links. If you prefer to write your source webpage in markdown, you can also use it with pandoc [1] like this (from the manual): ~~~ pandoc -s --gladtex input.md -o myfile.htex gladtex -d image_dir myfile.htex # produces myfile.html and images in image_dir ~~~ [0]: https://humenda.github.io/GladTeX/ https://humenda.github.io/GladTeX/ [1]: https://pandoc.org/MANUAL.html#math-rendering-in-html https://pandoc.org/MANUAL.html#math-rendering-in-html
- dinkelberg 5y agoIs there a reason why you do not want to use MathML for embedding equations in HTML? If not, it might be a good alternative to SVGs because MathML equations can be read aloud by screen readers. (If the screen reader is good.) MathJax, which uses MathML internally, claims to improve accessibility also for users of "bad" screenreaders. [1] Apparently, you can use pandoc to convert markdown files with LaTeX equations to HTML with embedded MathML using "pandoc math.text -s --mathml -o mathMathML.html". [2] [1] https://docs.mathjax.org/en/latest/basic/accessibility.html#screen-reader-support https://docs.mathjax.org/en/latest/basic/accessibility.html#... [2] https://tex.stackexchange.com/a/352636 https://tex.stackexchange.com/a/352636
- boramalper 5y ago> The only JS I need on my blog is Mathjax. Is there a static site generator that can render latex equations into svg's automatically? KaTeX. https://katex.org/docs/api.html#server-side-rendering-or-rendering-to-a-string https://katex.org/docs/api.html#server-side-rendering-or-ren... Though not to SVG, see https://github.com/KaTeX/KaTeX/issues/375 https://github.com/KaTeX/KaTeX/issues/375 tracking the progress.
- anthk 5y agoLearn groff, pic and eqn under Linux/Unix and use groff to export to HTML5.