Commit 97941530 by David Baumgold

Configure MathJax using require.js

parent 38153f95
...@@ -33,7 +33,7 @@ requirejs.config({ ...@@ -33,7 +33,7 @@ requirejs.config({
"draggabilly": "xmodule_js/common_static/js/vendor/draggabilly.pkgd", "draggabilly": "xmodule_js/common_static/js/vendor/draggabilly.pkgd",
"domReady": "xmodule_js/common_static/js/vendor/domReady", "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", "youtube": "//www.youtube.com/player_api?noext",
"tender": "//edxedge.tenderapp.com/tender_widget" "tender": "//edxedge.tenderapp.com/tender_widget"
...@@ -114,7 +114,19 @@ requirejs.config({ ...@@ -114,7 +114,19 @@ requirejs.config({
exports: "tinymce" exports: "tinymce"
}, },
"mathjax": { "mathjax": {
exports: "MathJax" exports: "MathJax",
init: ->
MathJax.Hub.Config
tex2jax:
inlineMath: [
["\\(","\\)"],
['[mathjaxinline]','[/mathjaxinline]']
]
displayMath: [
["\\[","\\]"],
['[mathjax]','[/mathjax]']
]
MathJax.Hub.Configured()
}, },
"xmodule": { "xmodule": {
exports: "XModule" exports: "XModule"
......
...@@ -33,7 +33,7 @@ requirejs.config({ ...@@ -33,7 +33,7 @@ requirejs.config({
"draggabilly": "xmodule_js/common_static/js/vendor/draggabilly.pkgd", "draggabilly": "xmodule_js/common_static/js/vendor/draggabilly.pkgd",
"domReady": "xmodule_js/common_static/js/vendor/domReady", "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", "youtube": "//www.youtube.com/player_api?noext",
"tender": "//edxedge.tenderapp.com/tender_widget.js" "tender": "//edxedge.tenderapp.com/tender_widget.js"
...@@ -114,7 +114,19 @@ requirejs.config({ ...@@ -114,7 +114,19 @@ requirejs.config({
exports: "tinymce" exports: "tinymce"
}, },
"mathjax": { "mathjax": {
exports: "MathJax" exports: "MathJax",
init: ->
MathJax.Hub.Config
tex2jax:
inlineMath: [
["\\(","\\)"],
['[mathjaxinline]','[/mathjaxinline]']
]
displayMath: [
["\\[","\\]"],
['[mathjax]','[/mathjax]']
]
MathJax.Hub.Configured();
}, },
"xmodule": { "xmodule": {
exports: "XModule" exports: "XModule"
......
...@@ -69,7 +69,7 @@ var require = { ...@@ -69,7 +69,7 @@ var require = {
// externally hosted files // externally hosted files
"tender": "//edxedge.tenderapp.com/tender_widget", "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 // 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, // that require.js adds the ".js" to the query component of the URL,
// and leaves the path component intact. // and leaves the path component intact.
...@@ -157,7 +157,22 @@ var require = { ...@@ -157,7 +157,22 @@ var require = {
exports: "tinymce" exports: "tinymce"
}, },
"mathjax": { "mathjax": {
exports: "MathJax" exports: "MathJax",
init: function() {
MathJax.Hub.Config({
tex2jax: {
inlineMath: [
["\\(","\\)"],
['[mathjaxinline]','[/mathjaxinline]']
],
displayMath: [
["\\[","\\]"],
['[mathjax]','[/mathjax]']
]
}
});
MathJax.Hub.Configured();
}
}, },
"coffee/src/main": { "coffee/src/main": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment