MathJax showing multiple issues on a page.

106 views
Skip to first unread message

Hameer Abbasi

unread,
Sep 20, 2012, 11:02:32 PM9/20/12
to mathja...@googlegroups.com
On this page, MathJax is showing multiple bugs:
  1. It files late, well after the page is loaded.
  2. It doesn't use woff fonts (I have the .htaccess in place in the fonts directory).
  3. It doesn't use STIX fonts (I'm using STIX v1.1 on my Windows 7 machine)

Peter Krautzberger

unread,
Sep 21, 2012, 12:49:05 AM9/21/12
to mathja...@googlegroups.com
A timeout before anything happens is almost always a sign that MathJax
couldn't load the configuration file successfully. This is frequently
(and I think in your case) due to the following misconfiguration (cf
http://www.mathjax.org/docs/2.0/configuration.html#using-a-local-configuration-file-with-the-cdn):

A configuration file must always end with something like

MathJax.Ajax.loadComplete("http://myserver.com/MathJax/config/local/local.js");

The link structure in that line must match the link structure with
which the configuration file is called.

In your case, you called MathJax with

http://www.iolympiads.com/MathJax/MathJax.js?config=local/iolympiads-mathjax.js

So I think the line should be

MathJax.Ajax.loadComplete("[MathJax]/config/local/local.js");

I can't check more right now, but if this doesn't work, play around
with the link structure a little (try changing the folder structure or
switch to absolute links)

Let me know if this helps.
Peter.

PS: For me it uses locally installed fonts just fine right now so I
can't reproduce those issues.

Hameer Abbasi

unread,
Sep 22, 2012, 3:09:09 AM9/22/12
to mathja...@googlegroups.com
Thanks a lot, that helped solve the issue with slow loading perfectly. I used
MathJax.Ajax.loadComplete("[MathJax]/config/local/iolympiads-mathjax.js");
at the end of my file, which worked just fine.

Hameer Abbasi

unread,
Sep 22, 2012, 3:20:41 AM9/22/12
to mathja...@googlegroups.com
Regarding the locally installed fonts, I was using STIX-Word instead of STIX-General, because, according to the readme, it appeared to be the "new thing", with the entire font in fewer *.otf files. I installed STIX-General and things are fine, now. I think you should mention that on your page about STIX, and add support for the Word versions, if that's not too much.

Hameer Abbasi

unread,
Sep 23, 2012, 2:24:41 AM9/23/12
to mathja...@googlegroups.com
I think MathJax is showing me it uses otf even though it's really using woff fonts.

Network request inspection of *.woff

.htaccess (In [MathJax]/fonts):

SetEnvIf Origin "^(.*\.?iolympiads\.com)$" ORIGIN_SUB_DOMAIN=$1
<FilesMatch "\.(ttf|otf|eot|woff)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "%{ORIGIN_SUB_DOMAIN}e" env=ORIGIN_SUB_DOMAIN
    AddType application/vnd.ms-fontobject .eot
    AddType application/x-font-ttf        .ttf
    AddType application/x-font-woff       .woff
    AddType application/x-font-opentype   .otf
  </IfModule>
</FilesMatch>

I have my server configured, and yet, if I go to About MathJax, it gives me this:

In the example page for the Firefox console on the example page, I get

[11:10:49.891] GET http://www.iolympiads.com/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size4-Regular.woff [HTTP/1.1 200 OK 436ms]
[11:10:49.913] GET http://www.iolympiads.com/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Regular.woff [HTTP/1.1 200 OK 938ms]
[11:10:49.916] GET http://www.iolympiads.com/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Math-Italic.woff [HTTP/1.1 200 OK 944ms]
[11:10:49.917] GET http://www.iolympiads.com/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size1-Regular.woff [HTTP/1.1 200 OK 760ms]
[11:10:51.279] GET http://www.iolympiads.com/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size2-Regular.woff [HTTP/1.1 200 OK 432ms]

And no other HTTP requests for any other other type of fonts. You can verify all of this yourself. Conclusion: MathJax is telling me it uses otf when it's really using woff.

Davide P. Cervone

unread,
Sep 23, 2012, 11:01:21 AM9/23/12
to mathja...@googlegroups.com
I'm glad you got the configuration worked out. I saw that Peter had
given the wrong file name, but I see you were able to put in the
correct one.

I was also going to ask if you were using the STIXGeneral, etc, or
STIX and STIX-Math versions of the STIX fonts, as MathJax can only use
the original STIXGeneral (and the other fonts in that series) version
of STIX. Unfortunately, the STIX fonts designed for use with Word put
many of the mathematical symbols in the range U+11000 and above, which
is outside the range of character that are accessible by UTF-16
encoding. I have not found a way to access those characters from
within any web browser, so that makes the Word version of the STIX
fonts unusable by MathJax. (This is also true of a number of other
fonts designed for use with Word that MathJax could have used.) So it
is not that we don't want to support the STIX-for-word fonts, it is
that there are technical reasons that we can't.

Finally, I noticed that your installation of MathJax is the original
v2.0 distribution, not the v2.0-latest copy, so you might consider
updating that, as there were a number of important fixes that were
issues fairly quickly after the v2.0 release. The link near the
bottom of

http://www.mathjax.org/download/

is to the v2.0-latest branch.

Davide

Davide P. Cervone

unread,
Sep 23, 2012, 11:03:44 AM9/23/12
to mathja...@googlegroups.com
When MathJax requests an OTF font, it asks for it in both OTF and WOFF format, and the browser determines which version to obtain.  MathJax doesn't actually know which it receives.  I suppose it could say "OTF or WOFF fonts" in its about box instead.  

Davide

Hameer Abbasi

unread,
Sep 23, 2012, 11:56:16 AM9/23/12
to mathja...@googlegroups.com
I found a very simple way that works in both Firefox v15.0.1 and Internet Explorer 9, and I haven't tested further (to use this file, you must have STIX Math installed on your PC (Word version). Thanks for the heads up about the update. The git master branch (I used git clone) was still pointed to the v2.0 original for some reason. I used git pull origin pretty often, about once every 15 days.
test.html

Hameer Abbasi

unread,
Sep 23, 2012, 12:10:27 PM9/23/12
to mathja...@googlegroups.com
Also, Dreamweaver CS6 reports no Browser Compatability issues, and the document appears to be valid HTML5. :D

Davide P. Cervone

unread,
Sep 23, 2012, 12:13:52 PM9/23/12
to mathja...@googlegroups.com
Yes, your method certainly works for characters below &#x10FFFF; but the problem is that the STIX-Math font includes many important symbols in the &#x110000; range, outside the range that can be addressed by UTF-16.  I see I left off a zero in my earlier message, which accounts for the confusion, I'm sure.  Sorry about that.  Many symbols that MathJax needs are in the STIX-Math font at &#x110000; and above.

Davide


<test.html>

Reply all
Reply to author
Forward
0 new messages