MathJax - File not uploaded: /extensions/MathZoom.js

I decided to use mathjax in one of my web projects, and I have a problem that I cannot understand.

First point: I created my own CDN site, where I got the version of mathjax version 2.0, for example: "http://mathjax.example.com".

my webapplication was developed in asp.net mvc3 + razor, and before I decided to create a cdn site, I used a standard script and it worked fine: <script type = "text / javascript" src = "http: //cdn.mathjax .org / mathjax / 1.1-latest / MathJax.js "> </script>

But the external CDN does not serve my client goals, and for this reason I have to create the cdn site on the same server.

Well, I downloaded the zip file and installed it in the directory served on my web server.

my problem is that if I point the old url to the new one: it does not work, and in the end I have a message in the lower left corner of the browser. "File not uploaded: /extensions/MathZoom.js"

- do I need some configuration somewhere?

+6
source share
3 answers

MathJax will probably not be able to locate its own root directory with which additional file URLs are allowed, or you really skip the extensions folder.

Something that bit me: the main javascript MathJax file cannot be renamed - it MUST remain "anypath / MathJax.js". Renaming it and trying to download, I got exactly the error that you mentioned, without finding the root path "anypath".

In addition, you, of course, need to deploy the entire package, and not just the main MathJax file.

Finally, I noticed that you used version 1.1 on the CDN and said that you deployed 2.0. Is it on purpose?

Hope this helps.

+2
source

This can happen for two reasons.

1. You may not have extracted the entire zip folder, so do this first.

However, you get an error for the second reason.

2. You do not mean the file correctly. eg:

<script type ="text/javascript" src="pathto\mathjax.js"> 

You have entered an invalid file name. The correct file name is MathJax.js.Given below is the correct path.

 <script type ="text/javascript" src="pathto\mathjax.js"> 

MathJax.js is the name of the file in the extracted folder (if not changed)

If all this does not work, then refer to the script as follows:

 <script type="text/javascript" src="Pathto/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> 

The reason your script is not working is because you are not including:

? Config = TeX-AMS-MML_HTMLorMML

+2
source

I wanted to link the MathJax library to main.min.js. My idea was used with Gulp, but without success.

It seems to me that there are dependencies for MathJax.js throughout the mathjax directory. I could not even separate this fragment of the scrpit script from a separate file (perhaps because of this type: type = "text / x-mathjax-config").

Then I could not even use the mathJax script tag without this configuration parameter :? config = TeX-AMS-MML_HTMLorMML. This will not work:

 <script type="text/javascript" src="path/to/MathJax.js"></script> 

It works. This is a CDN. 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, the MathJax documentation is a mess. I would be grateful if someone solves this problem.

+1
source

Source: https://habr.com/ru/post/910623/


All Articles