Chrome/Firefox extensions to speed up Mathjax

159 views
Skip to first unread message

lumo

unread,
Apr 11, 2012, 4:53:47 AM4/11/12
to mathja...@googlegroups.com
I hope that many others also experience a computer frozen for 10 seconds when you turn it on and open a Mathjax-equipped page in Chrome for the first time. One may survive the waiting but it's plausible one could get rid out lives of it, too.

Wouldn't it be a good idea to provide frequent clients visiting pages with Mathjax with a Chrome extension and/or Firefox add-on that would store the copy of the newest Mathjax files (only one set of local TeX fonts, OTF, could be enough) and that would replace all "loading scripts from remote pages" by "loading scripts from the local backup"? Of course, there are some question marks - whether the extension should store just the newest version of Mathjax or some older ones as well - but it could speed up things a bit, couldn't it?

This extension could exploit the standard procedures for (automatic) updates of the extensions to the newest version etc...

Frédéric WANG

unread,
Apr 11, 2012, 5:28:22 AM4/11/12
to mathja...@googlegroups.com
Hi,

You may be interested in this Firefox add-on (probably something can be
written for Chrome too):

https://addons.mozilla.org/en-US/firefox/addon/mathml-fonts/

FYI, this add-on is intended to be used with Firefox's MathML rendering,
although there is still some work in progress to make it work correctly
in that case (see https://bugzilla.mozilla.org/show_bug.cgi?id=295193).
It is planned to be recommended to Firefox users in some situations
(when MathML operator stretching fails) via a information bar.

I think that should do what you want for the HTML-CSS rendering. However
It seems that image fonts are used with this add-on when the config
forces local fonts (I have to verify that and wanted to discuss this
issue with Davide). Also, there is a bug in Fennec XUL that prevents
this add-on to work, which is a same since your proposal is really
important for mobile platforms...

--
Frédéric Wang
maths-informatique-jeux.com/blog/frederic

Frédéric WANG

unread,
May 5, 2012, 8:47:27 AM5/5/12
to mathja...@googlegroups.com
Hi all,

Finally I found time to test the add-on again:

https://addons.mozilla.org/en-US/firefox/addon/mathml-fonts/

It seems that MathJax is not able to use the fonts provided by the
add-on when the HTML-CSS rendering mode is used. I suppose MathJax tries
to detect local fonts first and if they are not present it switches to
Web or image fonts. But the fonts used by the add-on are Web fonts too,
so MathJax is not able to detect them. Davide, any ideas to solve this
problem?

The add-on is an *.xpi file but actually just a zip archive. If you open
it, you'll see a "resource/" directory. It contains a "mathml.css" style
sheet with @font-face rules and a "MathML-fonts/" directory with
MathJax, Asana and STIX fonts.

BTW, this add-on will be compatible with Firefox 15's MathML rendering
and I expect more and more people to have it installed. In particular, I
expect that in the future an information bar will suggest users to
download it when math fonts are missing.
Reply all
Reply to author
Forward
0 new messages