STIX fonts problem?

229 views
Skip to first unread message

YikYak

unread,
Oct 12, 2012, 4:53:47 AM10/12/12
to mathja...@googlegroups.com
Hi,

Sorry, I think this is not really a MathJax problem, I just need some advice.

I am using MathJax in a WordPress blog, both are local installs. I didn't really do much with the MathJax set up, just take it (v 2.0) configured as it comes, with a few marcos added. I have a lot of maths related posts, and was trying to create a large pdf from a collection of them. In the browser everything displays nicely, but when I try and create a pdf there is some software crash that causes everything to hang.

I think it is a problem with the STIX fonts, since I had similar problems regularly with an older release of them. Everything is fine when I remove these fonts from my machine, I can get a pdf.

I should like to try and find out (and fix) exactly which bit of MathJax is causing it. Please can you suggest if/how I can configure MathJax so that, for certain equations only, it does not use the STIX fonts?

As a secondary question, the MathJax site suggests installing STIX fonts locally to speed up typesetting. My readers are students who will often want to make pdf copies from my blog, is there a fall back set of fonts (and where do I get them) to install locally if I can't use the STIX fonts? I can't recommend STIX to them if the maths is causing crashes.

Thank you
YikYak

Davide P. Cervone

unread,
Oct 19, 2012, 6:26:30 PM10/19/12
to mathja...@googlegroups.com
> I am using MathJax in a WordPress blog, both are local installs. I
> didn't really do much with the MathJax set up, just take it (v 2.0)
> configured as it comes, with a few marcos added. I have a lot of
> maths related posts, and was trying to create a large pdf from a
> collection of them. In the browser everything displays nicely, but
> when I try and create a pdf there is some software crash that causes
> everything to hang.

How is the PDF being generated? Is it through the browser's print
command, or via a WordPress plugin of some sort? What browser and OS
are you using (and what versions)?

> I should like to try and find out (and fix) exactly which bit of
> MathJax is causing it. Please can you suggest if/how I can configure
> MathJax so that, for certain equations only, it does not use the
> STIX fonts?

MathJax is not set up to use more than one set of fonts on the same
page, so you will not be able to do that. Have you narrowed the
problem down to a specific equation (or is that what you are trying to
do)?

> As a secondary question, the MathJax site suggests installing STIX
> fonts locally to speed up typesetting. My readers are students who
> will often want to make pdf copies from my blog, is there a fall
> back set of fonts (and where do I get them) to install locally if I
> can't use the STIX fonts? I can't recommend STIX to them if the
> maths is causing crashes.

You could try installing the MathJax fonts locally; they are available
at

https://github.com/mathjax/MathJax/tree/master/fonts/HTML-CSS/TeX/otf

There may be some issues with earlier version of IE in some versions
of Windows, which had problems accessing the greek letters from these
fonts at one point.

Davide

YikYak

unread,
Oct 20, 2012, 5:29:45 AM10/20/12
to mathja...@googlegroups.com

Thanks Davide for a reply, my follow up is embedded below.

On Friday, October 19, 2012 11:26:32 PM UTC+1, Davide Cervone wrote:
> but  
> when I try and create a pdf there is some software crash that causes  
> everything to hang.

How is the PDF being generated?  Is it through the browser's print  
command, or via a WordPress plugin of some sort?  What browser and OS  
are you using (and what versions)?

The pdf is via the browsers print (ctrl-p) and using PDF creator. I'm on Win XP - SP3 and as up to date as XP can be, Firefox latest.
As an aside, if anyone knows a WordPress plugin that will create pdf with processed MathJax, I'd love to know which it is, the ones
I tried a while ago just wouldn't do the MathJax.

> I should like to try and find out (and fix) exactly which bit of  
> MathJax is causing it. Please can you suggest if/how I can configure  
> MathJax so that, for certain equations only, it does not use the  
> STIX fonts?

MathJax is not set up to use more than one set of fonts on the same  
page, so you will not be able to do that.  Have you narrowed the  
problem down to a specific equation (or is that what you are trying to  
do)?


Yes, I am trying to narrow it down to the problem post/equation whatever it turns out to be.
Sorry for what may well be a basic question, but how would I configure the fonts for a single page to avoid STIX?
(I can perhaps split the content over several WP posts, and hide any problematic content from archives etc, or make some
other adjustment as a work around once I find the problem part)

> As a secondary question, the MathJax site suggests installing STIX  
> fonts locally to speed up typesetting. My readers are students who  
> will often want to make pdf copies from my blog, is there a fall  
> back set of fonts (and where do I get them) to install locally if I  
> can't use the STIX fonts? I can't recommend STIX to them if the  
> maths is causing crashes.

You could try installing the MathJax fonts locally; they are available  
at

        https://github.com/mathjax/MathJax/tree/master/fonts/HTML-CSS/TeX/otf

There may be some issues with earlier version of IE in some versions  
of Windows, which had problems accessing the greek letters from these  
fonts at one point.

 Thanks, I'll give those a try as well.

Davide P. Cervone

unread,
Oct 20, 2012, 6:56:55 AM10/20/12
to mathja...@googlegroups.com
The pdf is via the browsers print (ctrl-p) and using PDF creator. I'm on Win XP - SP3 and as up to date as XP can be, Firefox latest. 

OK, thanks.

MathJax is not set up to use more than one set of fonts on the same  
page, so you will not be able to do that.  Have you narrowed the  
problem down to a specific equation (or is that what you are trying to  
do)?


Yes, I am trying to narrow it down to the problem post/equation whatever it turns out to be.
Sorry for what may well be a basic question, but how would I configure the fonts for a single page to avoid STIX?

You can use 

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  "HTML-CSS": {
    availableFonts: ["TeX"]
  }
});
</script>

to disable the STIX fonts (by removing them from the available font list).

(I can perhaps split the content over several WP posts, and hide any problematic content from archives etc, or make some
other adjustment as a work around once I find the problem part)

There may be an easier way to handle this, which is to do something like the following:

<script type="text/x-mathjax-config">
MathJax.Hub.Queue(function () {
  var math = MathJax.Hub.getAllJax();
  for (var i = 0, m = math.length; i < m; i++) {
    math[i].Remove(true); // removes the output but keeps the jax
  }
  for (i = 0; i < m; i++) {
    math[i].Rerender(); // put this one back on the page
    print();    // print the page with that equation (and all previous ones) showing
  }
});
</script>

This will remove all the math output, then go through one equation at a time and put it back, then print the page.  You should come to a point when the page no longer prints, and that equation will be the problem one.  You could console.log(i) in the second loop, or console.log(math[i].originalText) to get an indication in the console log about which expression is the problem.

Davide
Reply all
Reply to author
Forward
0 new messages