Skip to content

Instantly share code, notes, and snippets.

@adeel
Created September 9, 2020 12:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adeel/1640e016702dbbc40512598941257b03 to your computer and use it in GitHub Desktop.
Save adeel/1640e016702dbbc40512598941257b03 to your computer and use it in GitHub Desktop.
Enable MathJax in Roam (this goes in roam/js).
window.MathJax = {
tex: {
inlineMath: [["$","$"]],
displayMath: [["\\[","\\]"]],
processEscapes: true,
}
};
(function() {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js";
document.getElementsByTagName("head")[0].appendChild(script);
(doTypeset = function() {
window.setTimeout(doTypeset, 700);
if (MathJax.startup) {
MathJax.startup.promise = MathJax.startup.promise.then(
() => {return MathJax.typesetPromise()}
).catch(
(err) => console.log('Typeset failed: ' + err.message)
);
}
})();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment