i've decided to use mathjax in one of my web projects and i'm getting a issue that i cannot understand.
First point: i've created my own CDN website where i've istalled the 2.0 version of mathjax on some url like: "http://mathjax.example.com".
my webapplication is developed in asp.net mvc3+razor and before i've decided to create a cdn website, i was using the standard script an it was working perfectlly: <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/1.1-latest/MathJax.js"></script>
But, external CDN does not serve my client purposes, and for that reason i've to create a cdn website on the same server.
Well i've downloaded the zip file and installed on a directory served on my webserver.
my problem is that if i point the old url to the new: it does not works, and at the end i've a message on my lower left browser corner "File failed to load: /extensions/MathZoom.js"
is that necessary some configuration somewhere?
Likely, MathJax fails to detect its own root directory against which additional files urls are resolved, or you actually miss the extensions folder.
Something that I got bitten by: the main MathJax javascript file can't be renamed - it MUST stay "whateverpath/MathJax.js". Renaming it and trying to load got me exactly the error you mentioned, by failing to detect the root path "whateverpath".
Also, you obviously need to deploy the whole package, not just the MathJax main js file.
Finally, I notice you used the 1.1 version on the CDN, and said you deployed 2.0. Is this on purpose?
Hope that helps.
This may occur due to two reasons
1.You may have not extracted the entire zip folder, so first do that.
Still you are getting the error look into second reason.
2.You are not referring to the file correctly. eg:
<script type ="text/javascript" src="pathto\mathjax.js">
You have typed an incorrect filename. Correct name of file is MathJax.js.Given below is the correct way.
<script type ="text/javascript" src="pathto\MathJax.js">
MathJax.js is the name of the file in the extracted folder(unless modified)
If all of this is not working,then link to the script in this way:
<script type="text/javascript" src="Pathto/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
The reason that your script is not working is you are not including:
'?config=TeX-AMS-MML_HTMLorMML'
I wanted to bundle MathJax library into my production main.min.js file. My idea was use it with Gulp, but without success.
It seems to me that there are dependencies for MathJax.js all over mathjax directory. I even couldn't separate that config scrpit snippet into separate file (probably because of that type: type="text/x-mathjax-config").
Then I couldn't even use mathJax script tag without that config parameter: ?config=TeX-AMS-MML_HTMLorMML. This won't work:
<script type="text/javascript" src="path/to/MathJax.js"></script>
This works. It is CDN.Currently I am still using this code:
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS": {
preferredFont: "STIX",
linebreaks: { automatic: true, width: "53%" }
}
});
<script type="text/javascript"
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
For me MathJax documentation is a mess. I would appreciate if someone solve this problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With