InsaneCoder
InsaneCoder

Reputation: 8268

mathjax preview not working

I am trying to develop a simple page for offline use where I can write mathjax(tex) in a textarea and can see the output in underlying div

I have copied the entire code from here.

The problem is that my math say \theta is not converting into notations. Just by mere guess I found that the problem is with MathJax.js

When I use (online MathJax library)

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

it works fine.

But when I save the MathJax.js into the local folder and change the path to

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

it doesn't work. I am not getting any error and js file is also loading but still it doesn'tt work in local case. Can it be due to the config parameters at the end of the url?

Upvotes: 1

Views: 637

Answers (1)

InsaneCoder
InsaneCoder

Reputation: 8268

Alone downloading the MathJax.js locally is not sufficient. MathJax uses other files also for processing which are needed by MathJax.js itself. As per MathJax.org,

There are a number of extensions for the TeX input processor that are loaded by the TeX-AMS-MML_HTMLorMML configuration. These include:

  • TeX/AMSmath.js, which defines the AMS math environments and macros,

  • TeX/AMSsymbols.js, which defines the macros for the symbols in the msam10 and msbm10 fonts,

  • TeX/noErrors.js, which shows the original TeX code rather than an error message when there is a problem processing the TeX, and
  • TeX/noUndefined.js, which prevents undefined macros from producing an error message, and instead shows the macro name in red.

So, download the entire package from github, extract it locally and link to MathJax.js in your webpage.

Upvotes: 1

Related Questions