MathJax 2.6.1 downloading fonts from parent of root

Sett 74 ganger
Hopp til første uleste melding

dustf...@starbucksoftware.com

ulest,
29. sep. 2016, 13:51:3629.09.2016
til MathJax Users
Hi,

I have an issue where mathjax is looking for fonts in the wrong location. It is looking for fonts in the parent of the root directory. As you can see in my mathjax configuration that I have set both MathJax.Hub.Config.root and MathJax.Ajax.config.root to "~/scripts/libs/mathjax", but I keep getting loads of warnings that "~/scripts/libs/mathjax/jax/output/HTML-CSS/jax.js?rev=2.6.1" is failing to decode fonts from "~/scripts/libs/". The weird thing is that chrome is getting a status code of 200 for the request, but the response has no data (since that is not where the fonts are located). The consequence of all this is that in"~/scripts/libs/mathjax/jax/output/HTML-CSS/imageFonts.js?rev=2.6.1" on line 184 HTMLCSS.FONTDATA.FONTS["MathJax_Main"][0x2014][5] is undefined.
var GETWIDTHS = function () {
      var img = HTMLCSS.FONTDATA.FONTS["MathJax_Main"][0x2014][5].img; // em-dash
      HTMLCSS.imgEmWidth = [];
      for (var i = 0, m = img.length; i < m; i++) {HTMLCSS.imgEmWidth[i] = img[i][0]}
    };

In chrome debugger console I see the error:
imagedata.js?rev=2.6.1:2 Uncaught SyntaxError: Unexpected token <
MathJax.js:241 Uncaught TypeError: Cannot read property 'img' of undefined

Here is the latex math that it is trying to process when this all goes bad:
<p>My list of latex equations.&nbsp;ccg</p>
<p>$$ 2 + 2 = 2^2 $$</p>
<p>$$ 4 - 0 + (5*0 + (6*0 - 7*0) +1 - 1) = 2^2 + (5*0 + (6*0 - 7*0) +1 - 1) $$</p>
<p>$$ 4 - 0 + (5*0 + (6*0 - 7*0) +1 - 1) = 2^2 + (5*0 + (6*0 - 7*0) +1 - 1) $$</p>
<p>$$ 4 - 0 + (5*0 + (6*0 - 7*0) +1 - 1) = 2^2 + (5*0 + (6*0 - 7*0) +1 - 1) $$</p>
<p>$$ 4 - 0 + (5*0 + (6*0 - 7*0) +1 - 1) = 2^2 + (5*0 + (6*0 - 7*0) +1 - 1) $$</p>

Thank you in advance.

dustf...@starbucksoftware.com

ulest,
30. sep. 2016, 14:24:3130.09.2016
til MathJax Users
I was using the unminified version of mathjax.js and imagedata.js.  The minified version looks for  the fonts directory in the correct path.

Davide Cervone

ulest,
1. okt. 2016, 08:45:5001.10.2016
til mathja...@googlegroups.com
Because the unpacked and packed version share the same fonts folder, the unpacked version (correctly) looks one directory higher to find the fonts.  If you have moved the unpacked version to be the top level directory, that will cause it to look in the wrong place, as you have found.  

There is a line

// MathJax.isPacked = true; // This line is uncommented by the packer.

around line 45 that is commented out in the unpacked version.  If you uncomment that, it will look for the fonts in the same directory as MathJax.js instead.

Davide 


On Sep 30, 2016, at 2:24 PM, dustf...@starbucksoftware.com wrote:

I was using the unminified version of mathjax.js and imagedata.js.  The minified version looks for  the fonts directory in the correct path.

--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Svar alle
Svar til forfatter
Videresend
0 nye meldinger