Hi Kovid,
Sorry for the delay -- for a couple of these I had to ask our lead developer Davide Cervone for advice.
1) Can we use the unpacked javascript? I much prefer using unpacked javascript as it allows easier debugging and local modifications.
No reason not to use the unpacked version for a local installation. But I don't recommend making local modifications directly to the code. The "right" way (from a MJ point of view) is having your configuration include the patches -- easier to update MathJax that way. There are examples of this on the MathJax-user forum. I also tend to suggest a configuration file, not inline configurations. Generally, see
http://www.mathjax.org/docs/2.0/configuration.html
2) Are there any other config options apart from imageFonts:null to use to suppress warnings with svg output and no fonts? Though looking at the code, it seems like imageFonts is no longer needed.
SVG doesn't use imageFonts:null, only the HTML-CSS output, so no need to specify it for SVG. Since you have disabled the menu, they can't switch to that renderer, but you don't want to allow that anyway, since you don't include the code. So if you ever re-enable to menu, you will want to include
MathMenu: {
showRenderer: false
}
to disable the renderer menu.
3) What would be a good way of allowing the user to specify parts of the config via a script tag in the document while still setting most of it in calibre code. I suppose I could define my own config function, but I was hoping that there exists a canonical way to do it.
MathJax looks for <script type="text/x-mathjax-config">...</script> blocks to do its configuration. If the user can include those (before(!) the script that loads MathJax.js itself), then those can be used for user-configuration of MathJax. Alternatively, (if you choose to switch to configuration files), you can keep the user configuration in a separate file and load both. Again, see
http://www.mathjax.org/docs/2.0/configuration.html
One caveat: given that you've shrunk MathJax so much that you've lost functionality, user configurations might call features you've removed (like html+css output).
4) For some reason, none of the right click menu entries work in the calibre viewer.
(see 5)
4.5) Is there a config option that will allow mathjax to log errors using console.log? This makes debugging easier.
File errors can be obtained from MathJax.Message.Log() -- see
http://www.mathjax.org/docs/2.0/api/message.html. Other errors during processing will generate error signals, which can be trapped by a signal listener. The simplest would be to use
MathJax.Hub.signal.Interest(function (message) {console.log(message)});
but this will show ALL the messages, not just errors.
UNTESTED: You could do something like
MathJax.Hub.signal.Interest(function (message) {if (String(message).match(/error/i) {console.log(message)}});
5) The HTML/CSS output and the right click menus dont work with calibre's viewer in paged mode. This is because the paged mode is implemented using the CSS3 columns module, which causes all the CSS positioning you use to break. You could probably fix that by using getBoundingClientRect to calculate positions rather than the usual offsetParent techniques.
Yes, this needs to be addressed. Thanks for the suggestion!
6) Equations do not reflow when the viewer window is too narrow for them, I assume that's by design? I see the same behavior in Chrome with both html/css output and svg output
There is a line breaking algorithm, but it is not enabled by default (it slows down processing). Note that it is not dynamic, so the equations don't reflow if the window changes, but it will break according to the size when the equations are first processed. To get it, use
MathJax.Hub.Config({
SVG: {linebreaks: {automatic: true}}
});
The algorithm is not perfect, but it should help. Note that it applies only to display equations, not in-line ones (unless they are too long to fit on a line by themselves).