5

I have some webpages, which make heavy use of MathJax (or MathML?) that I would like to convert into ebooks and display on my kindle, which does not support enough javascript, nor MathML. So I would like to preprocess the .html files, possibly by running MathJax during a preprocessing/compilation step, to replace uses of MathML with HTML/CSS. Are there any tools that will do this for me?

Jason Gross
  • 5,928
  • 1
  • 26
  • 53

1 Answers1

3

You would be better off replacing the MathML by SVG rather than HTML-CSS. MathJax's HTML-CSS output is different for different browsers, operating systems, font sizes, and several other factors, so if you save the HTML generated for one situation, it may not work properly for another. The SVG output is consistent across browsers.

There are some folks who have worked on doing this sort of thing already. The svgtex project is one. Wikipedia developed Mathoid to do something similar.

Davide Cervone
  • 11,211
  • 1
  • 28
  • 48
  • 1
    @PeterKrautzberger This is incorrect! Mathoid and SvgTex serve completely different purposes. Mathoid translates LaTeX math into a **JSON object** containing both **escaped** MML and SVG. One still needs JavaScript to do something with it. Mathoid was developed for use in [MediaWiki](https://en.wikipedia.org/wiki/MediaWiki), [Wikipedia's wiki engine](http://arxiv.org/abs/1404.6179). By contrast, SvgTex translates LaTeX math into an `` block for direct injection into (X)HTML. SvgTex is [**actively maintained!**](https://github.com/agrbin/svgtex) – Serge Stroobandt Jan 19 '15 at 23:18
  • There is now also the [MathJax-node](https://github.com/mathjax/MathJax-node) project. – Davide Cervone Jan 20 '15 at 00:05