Skip to content
Snippets Groups Projects
Commit 99e9f34f authored by Max Guichard's avatar Max Guichard
Browse files

MathJax not present bug

parent 6a8725e9
No related branches found
No related tags found
1 merge request!233Fix thebe on publish
Pipeline #212014 passed
......@@ -186,6 +186,7 @@ var configureThebe = () => {
thebelab.events.listeners.status.clear(); // Remove further status message handling
thebelab.on("status", function (evt, data) { // But we add one to trigger automatic Mathjax rendering
if (data.subject == 'cell' && data.status == 'idle') {
if (window.MathJax === undefined) { return; }
MathJax.typeset()
}
})
......@@ -434,11 +435,13 @@ var initThebe = async () => {
modifyDOMForThebe();
await thebelab.bootstrap(thebeLiteConfig);
// Setup MathJax settings for handling Jupyter output
localStorage.setItem("MathJax-Menu-Settings", '{"renderer":"SVG"}')
MathJax.config.tex.inlineMath = [['$', '$']] // Include $ delimeter to indicate Maths (used by IPython)
MathJax.config.options.processHtmlClass += "|jp-OutputArea-output" // Include Thebe output cells as containing Maths
MathJax.startup.getComponents() // Reset all built-in components
if (window.MathJax !== undefined) {
// Setup MathJax settings for handling Jupyter output
localStorage.setItem("MathJax-Menu-Settings", '{"renderer":"SVG"}')
MathJax.config.tex.inlineMath = [['$', '$']] // Include $ delimeter to indicate Maths (used by IPython)
MathJax.config.options.processHtmlClass += "|jp-OutputArea-output" // Include Thebe output cells as containing Maths
MathJax.startup.getComponents() // Reset all built-in components
}
document.querySelectorAll(".keep").forEach((kept, _) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment