Skip to content

Instantly share code, notes, and snippets.

@DouglasdeMoura
Created August 31, 2015 05:00
Show Gist options
  • Save DouglasdeMoura/ffa4ef48a61f4bfbe037 to your computer and use it in GitHub Desktop.
Save DouglasdeMoura/ffa4ef48a61f4bfbe037 to your computer and use it in GitHub Desktop.
MathJax.Hub.Config({
showProcessingMessages: false,
tex2jax: {
inlineMath: [
['$', '$'],
['\\(', '\\)']
]
},
extensions: [
'toMathML.js'
]
});
var math = null;
MathJax.Hub.queue.Push(function () {
math = MathJax.Hub.getAllJax('MathOutput') [0];
});
window.updateMathMl = function (math) {
document.getElementById('output').value = '<?xml version="1.0"?>' + math.root.toMathML('');
};
window.UpdateMath = function (TeX) {
MathJax.Hub.queue.Push(['Text',
math,
'\\displaystyle{' + TeX + '}'], [
updateMathMl,
math
]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment