diff --git a/docs/_layouts/global.html b/docs/_layouts/global.html
index 88d549c3f101..77edebeffdc2 100755
--- a/docs/_layouts/global.html
+++ b/docs/_layouts/global.html
@@ -184,7 +184,8 @@
{{ page.title }}
});
};
script.src = ('https:' == document.location.protocol ? 'https://' : 'http://') +
- 'cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML';
+ 'cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js' +
+ '?config=TeX-AMS-MML_HTMLorMML';
d.getElementsByTagName('head')[0].appendChild(script);
}(document));
diff --git a/docs/js/api-docs.js b/docs/js/api-docs.js
index 13514e11b933..287fce61540e 100644
--- a/docs/js/api-docs.js
+++ b/docs/js/api-docs.js
@@ -58,6 +58,7 @@ $(document).ready(function() {
});
};
script.src = ('https:' == document.location.protocol ? 'https://' : 'http://') +
- 'cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML';
+ 'cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js' +
+ '?config=TeX-AMS-MML_HTMLorMML';
document.getElementsByTagName('head')[0].appendChild(script);
});