Mathjax

32 views
Skip to first unread message

Jason Grout

unread,
Jan 14, 2012, 4:00:18 PM1/14/12
to Davide P. Cervone, William Stein, sage-notebook
Davide (CCd to the sage-notebook development list and William Stein),

I don't know if you've seen the recent activity on including mathjax in
the Sage notebook, but I think we're almost there (finally!). I spent
the last few days reviewing the current progress, making lots more
changes, and putting up a test server at test.sagenb.org. For example,
http://test.sagenb.org/home/pub/20/ is a public worksheet using MathJax.

I have a couple of questions, though:

1. Can you subscribe me (jason...@creativetrax.com) to the MathJax
users mailing list? Apparently I cannot subscribe a non-google address.

2. I specified in the config file these two options:

imageFont: null,
MathMenu: {
showFontMenu: true
}

However, the fonts menu still shows the image TeX fonts as an option.
Worse yet, when I select it, MathJax shows that it is trying to download
images, fails, then displays a red error message. Then there is no way
for me to get back to a menu to change my font choice anymore. It would
be great if right-clicking on the error message popped up the mathjax menu.

3. Is there any way to get the little box at the bottom of the page that
we had with jsmath, where we could click on it to get a MathJax menu?
Unfortunately, right-clicking on expressions doesn't work with the ipad,
for example.

4. Is there a way we can set things to default to a local TeX font, then
a web TeX font, instead of the STIX fonts? There have been some people
that complained that the STIX fonts were not as pretty.

The thread about this final testing stage for mathjax is here:

http://groups.google.com/group/sage-devel/browse_thread/thread/3af7717ce44ce3ac

(also here:
http://groups.google.com/group/sage-notebook/browse_thread/thread/3af7717ce44ce3ac)

Thanks again for all of your help with this,

Jason

--
Jason Grout

Jason Grout

unread,
Jan 14, 2012, 5:11:23 PM1/14/12
to Davide P. Cervone, Jason Grout, sage-notebook
(CCd to sage-notebook; William: Davide answers what the problem is that
you are seeing on Lion at the end of the message)

On 1/14/12 3:29 PM, Davide P. Cervone wrote:

>> 2. I specified in the config file these two options:
>>
>> imageFont: null,
>> MathMenu: {
>> showFontMenu: true
>> }
>>
>> However, the fonts menu still shows the image TeX fonts as an option.
>> Worse yet, when I select it, MathJax shows that it is trying to
>> download images, fails, then displays a red error message. Then there
>> is no way for me to get back to a menu to change my font choice
>> anymore. It would be great if right-clicking on the error message
>> popped up the mathjax menu.
>
>

> You need to put imageFont:null in the HTML-CSS block:

I've been reading the docs again, and I just realized that (and am
half-way through testing it). I'm glad to know I'm thinking correctly.

Another question: in Firefox 9.0.1 on OSX 10.6.8, it seems (i.e., the
option is selected in the menu) that the default is to use HTML-CSS
instead of MML, which seems to go contrary to what
http://www.mathjax.org/docs/1.1/options/MMLorHTML.html says.


>
> "HTML-CSS": {
> imageFont: null,
> },
> MathMenu: {
> showFontMenu: true
> }
>
> You are right that the image TeX fonts will still show. The menu is
> really just for me to do debugging, so wasn't set up to be as dynamic as
> it might be. I will send you some code that disables it if you want. But
> I think that if you put the imageFont in the right place, then selecting
> it will end up using a default unicode setup rather than causing an
> error. The error is due to the fact that you didn't really tell MathJax
> that the image fonts aren't there (since you told it in the wrong
> place), and it is still trying to load them.
>

That's good to know it will default back to unicode.


> MathJax v2.0 already handles the right-click on error messages.
>

Great!


>> 3. Is there any way to get the little box at the bottom of the page
>> that we had with jsmath, where we could click on it to get a MathJax
>> menu? Unfortunately, right-clicking on expressions doesn't work with
>> the ipad, for example.
>

> There is no built-in way to do that. (I was expressly forbidden from
> having a control panel during the design phase of MathJax. I put in the
> contextual menu without asking, in order to get the control functions
> that I needed.) It would be possible to write something, but I don't
> have any plans for that at the moment.

Okay. Maybe we'll look at writing something in the short term. Can we
manipulate the options from javascript?


>
>> 4. Is there a way we can set things to default to a local TeX font,
>> then a web TeX font, instead of the STIX fonts? There have been some
>> people that complained that the STIX fonts were not as pretty.
>

> I agree with them, but the STIX fonts do include a lot more symbols than
> the MathJax fonts. You can set
>
> "HTML-CSS": {
> availableFonts: ["TeX"]
> }
>
> to disable the STIX fonts. (This may be better than using the font menu,
> since changing fonts via the menu causes the page to be reloaded, and
> you might not want that).


Given the tradeoff, we'll probably vote on this issue. Thanks for
telling us how to do either way.


>
>> The thread about this final testing stage for mathjax is here:
>>
>> http://groups.google.com/group/sage-devel/browse_thread/thread/3af7717ce44ce3ac
>>
>

> The issue with the slantiness of fonts that William is having is due to
> a bug in OS X Lion, which ships with STIX fonts, but the Lion version of
> WebKit doesn't display them properly. See
>
> https://github.com/mathjax/MathJax/issues/178
> and
> https://github.com/mathjax/MathJax/issues/152
>
> for more details. It looks like the STIX 1.1beta fonts fix the problem,
> and I will work around it for v2.0 of MathJax, but for now, either
> disabling the STIX fonts via FontBook, or configuring MathJax not to use
> them (as described above) will avoid it.
>
> Thanks for letting me know about Sage's inclusion of MathJax. Let me
> know if there are other issues.

Thanks again for your help! I'm sorry I didn't catch some of these
answers in the (nicely written!) docs before emailing you.

Jason


Jason Grout

unread,
Jan 14, 2012, 5:30:43 PM1/14/12
to Davide P. Cervone, sage-notebook
On 1/14/12 4:25 PM, Davide P. Cervone wrote:
>> Another question: in Firefox 9.0.1 on OSX 10.6.8, it seems (i.e., the
>> option is selected in the menu) that the default is to use HTML-CSS
>> instead of MML, which seems to go contrary to what
>> http://www.mathjax.org/docs/1.1/options/MMLorHTML.html says.
>
> The settings are "sticky", meaning that they are saved in a cookie from
> session to session, so if you switched to HTML-CSS mode earlier, it will
> still be selected the next time you view pages from that same site. To
> revert to using the default, you need to remove the MathJax cookie for
> that site.

Interesting. Even when I switch to Private mode in FF 9.0.1, then
specifically clear the mathjax.org cookies, the menu on
http://www.mathjax.org/demos/tex-samples/ shows that I am using HTML-CSS
instead of MathML.

Thanks,

Jason


Jason Grout

unread,
Jan 14, 2012, 5:45:54 PM1/14/12
to Davide P. Cervone, sage-notebook
On 1/14/12 4:43 PM, Davide P. Cervone wrote:
> The www.mathjax.org site is set to use HTML-CSS rather than MML for
> Firefox. Frankly, there are too many bugs, limitations, and omissions in
> Firefox's implementation of MathML to make it work well with MathJax,
> and since we wanted all the output on www.mathjax.org to be beautiful,
> we force it to use HTML-CSS output instead. MathJax v2.0 will have that
> as the default, so that people will have to change to NativeMML
> rendering explicitly if they want that (that makes it their decision to
> trade accuracy for speed).

Thanks for the tip! I'll set our notebook to always use HTML-CSS as
well, then.

Thanks!

Jason

Reply all
Reply to author
Forward
0 new messages