diff --git a/cms/static/coffee/spec/main.coffee b/cms/static/coffee/spec/main.coffee index aba1e5405a..408f8e7f70 100644 --- a/cms/static/coffee/spec/main.coffee +++ b/cms/static/coffee/spec/main.coffee @@ -35,7 +35,7 @@ requirejs.config({ "draggabilly": "xmodule_js/common_static/js/vendor/draggabilly.pkgd", "domReady": "xmodule_js/common_static/js/vendor/domReady", - "mathjax": "//edx-static.s3.amazonaws.com/mathjax-MathJax-727332c/MathJax.js?config=TeX-MML-AM_HTMLorMML-full", + "mathjax": "//edx-static.s3.amazonaws.com/mathjax-MathJax-727332c/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured", "youtube": "//www.youtube.com/player_api?noext", "tender": "//edxedge.tenderapp.com/tender_widget" @@ -116,7 +116,19 @@ requirejs.config({ exports: "tinymce" }, "mathjax": { - exports: "MathJax" + exports: "MathJax", + init: -> + MathJax.Hub.Config + tex2jax: + inlineMath: [ + ["\\(","\\)"], + ['[mathjaxinline]','[/mathjaxinline]'] + ] + displayMath: [ + ["\\[","\\]"], + ['[mathjax]','[/mathjax]'] + ] + MathJax.Hub.Configured() }, "xmodule": { exports: "XModule" diff --git a/cms/static/coffee/spec/main_squire.coffee b/cms/static/coffee/spec/main_squire.coffee index 928e10c61f..377ddf2db3 100644 --- a/cms/static/coffee/spec/main_squire.coffee +++ b/cms/static/coffee/spec/main_squire.coffee @@ -35,7 +35,7 @@ requirejs.config({ "draggabilly": "xmodule_js/common_static/js/vendor/draggabilly.pkgd", "domReady": "xmodule_js/common_static/js/vendor/domReady", - "mathjax": "//edx-static.s3.amazonaws.com/mathjax-MathJax-727332c/MathJax.js?config=TeX-MML-AM_HTMLorMML-full", + "mathjax": "//edx-static.s3.amazonaws.com/mathjax-MathJax-727332c/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured", "youtube": "//www.youtube.com/player_api?noext", "tender": "//edxedge.tenderapp.com/tender_widget.js" @@ -116,7 +116,19 @@ requirejs.config({ exports: "tinymce" }, "mathjax": { - exports: "MathJax" + exports: "MathJax", + init: -> + MathJax.Hub.Config + tex2jax: + inlineMath: [ + ["\\(","\\)"], + ['[mathjaxinline]','[/mathjaxinline]'] + ] + displayMath: [ + ["\\[","\\]"], + ['[mathjax]','[/mathjax]'] + ] + MathJax.Hub.Configured(); }, "xmodule": { exports: "XModule" diff --git a/cms/templates/base.html b/cms/templates/base.html index 04aa735747..edc7791abc 100644 --- a/cms/templates/base.html +++ b/cms/templates/base.html @@ -71,7 +71,7 @@ var require = { // externally hosted files "tender": "//edxedge.tenderapp.com/tender_widget", - "mathjax": "//edx-static.s3.amazonaws.com/mathjax-MathJax-727332c/MathJax.js?config=TeX-MML-AM_HTMLorMML-full", + "mathjax": "//edx-static.s3.amazonaws.com/mathjax-MathJax-727332c/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured", // youtube URL does not end in ".js". We add "?noext" to the path so // that require.js adds the ".js" to the query component of the URL, // and leaves the path component intact. @@ -159,7 +159,22 @@ var require = { exports: "tinymce" }, "mathjax": { - exports: "MathJax" + exports: "MathJax", + init: function() { + MathJax.Hub.Config({ + tex2jax: { + inlineMath: [ + ["\\(","\\)"], + ['[mathjaxinline]','[/mathjaxinline]'] + ], + displayMath: [ + ["\\[","\\]"], + ['[mathjax]','[/mathjax]'] + ] + } + }); + MathJax.Hub.Configured(); + } }, "xblock/core": { exports: "XBlock",