Skip to content

How to: MathJax CDN fallback

Peter Krautzberger edited this page Feb 22, 2014 · 1 revision

A simple script to fallback to a local copy of MathJax if the CDN is offline (e.g., when you don't have a network connection).

    <!-- MathJax: Fall back to local if CDN offline -->
    <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
    <script>window.MathJax || document.write('<script type="text/x-mathjax-config">MathJax.Hub.Config({"HTML-CSS":{imageFont:null}});<\/script><script src="<<PATH_TO_YOUR_LOCAL_MATHJAX>>MathJax.js?config=TeX-AMS_HTML-full"><\/script>')</script>

For convenience, the configuration for the fallback deactivates image fonts support (imageFont:null). This allows you to host a slim local copy by deleting the PNG fonts.

Clone this wiki locally