3 ms·
Does someone know, if MathJax can be utilized as renderer for a static web site? I do this with KaTeX for my Pelican-based blog successfully, after I found no w
by mbeex 7y ago
Does someone know, if MathJax can be utilized as renderer for a static web site? I do this with KaTeX for my Pelican-based blog successfully, after I found no way to integrate MathJax easily into the workflow.
- abdullahkhalids 7y agoI believe you use Mathjax's node based tex2svg, and embed the results directly into your static site. https://github.com/mathjax/MathJax-demos-node/blob/master/component/tex2svg https://github.com/mathjax/MathJax-demos-node/blob/master/co...
- mbeex 7y agoBut this would give <svg> only, right? With KaTeX, I can produce MathML, HTML or both at compile time.
- qubyte 7y agoI commented elsewhere, but yes it can! It took a bit of head scratching but I got there in the end with my own Node.js based static site generator. This code integrates version 3 of MathJax, which was considerably different to version 2. https://github.com/qubyte/qubyte-codes/blob/master/lib/render.js https://github.com/qubyte/qubyte-codes/blob/master/lib/rende... See in particular the top of that file, and the renderMaths function. I'm not sure how you'll integrate MathJax into Pelican given the language gap, but in principle it's possible.
- mbeex 7y agoMy KaTex/Pelican-based solution is here (don't mind - new blog, no real content yet, but the technical side is visible): https://depot.traits.de/ https://depot.traits.de/ Feature test here: https://depot.traits.de/pages/2020/02/21-rest-example.html https://depot.traits.de/pages/2020/02/21-rest-example.html
- eddieh 7y agoI'm using KaTeX as well, but there's also https://dlmf.nist.gov/LaTeXML/ https://dlmf.nist.gov/LaTeXML/ (GitHub: https://github.com/brucemiller/LaTeXML https://github.com/brucemiller/LaTeXML) I want to switch to LaTeXML eventual over KaTeX (via embedded JavaScript), but my blog workflow is based on Emacs Org-mode and it was much easier to replace Org's native MathJax with KaTeX.