Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MathJax not working if loaded from local js file or if the source code is included

I am testing the MathJax javascript library in a local HTML file. It works and correctly renders math formulas if I include:

script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'

in the HTML file, but it doesn't work if I include instead:

script type="text/javascript" src="/path_to/mathjax.js"

or even if I put the entire javascript source code. What is the reason? I need to load mathjax.js from local js file into a local HTML file, so the first way doesn't help me. (EDIT- I see an error: failed to load /extensions/MathZoom.js)

like image 336
P5music Avatar asked Oct 06 '13 11:10

P5music


People also ask

Why is MathJax not working?

MathJax fails to load if the site is being viewed through HTTPS, which it is if HTTPS Everywhere. Disable HTTPS Everywhere for just this site, and then reload the page without HTTPS.

Is MathJax open source?

MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all modern browsers.

How can I download MathJax?

Obtaining MathJax via an archive Release versions of MathJax are available in archive files from the MathJax GitHub page. The current version is available via the “clone or download” button, or you can use the “releases” tab to download an archive for an older version.


1 Answers

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'

like image 161
coder Avatar answered Oct 14 '22 18:10

coder