diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js
index 707999c31..2a276b7b6 100644
--- a/unpacked/jax/output/CommonHTML/jax.js
+++ b/unpacked/jax/output/CommonHTML/jax.js
@@ -415,7 +415,10 @@
// Add the node for the math and mark it as being processed
//
jax = script.MathJax.elementJax; if (!jax) continue;
- jax.CHTML = {display: (jax.root.Get("display") === "block")}
+ jax.CHTML = {
+ display: (jax.root.Get("display") === "block"),
+ preview: (jax.CHTML||{}).preview // in case typeset calls are interleaved
+ };
node = CHTML.Element("mjx-chtml",{
id:jax.inputID+"-Frame", className:"MathJax_CHTML", isMathJax:true, jaxID:this.id,
oncontextmenu:EVENT.Menu, onmousedown: EVENT.Mousedown,
diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js
index 63f39014a..d9dacc284 100644
--- a/unpacked/jax/output/HTML-CSS/jax.js
+++ b/unpacked/jax/output/HTML-CSS/jax.js
@@ -683,7 +683,7 @@
// Get the data about the math
//
var jax = script.MathJax.elementJax, math = jax.root,
- span = document.getElementById(jax.inputID+"-Frame"),
+ span = script.previousSibling;
div = (jax.HTMLCSS.display ? (span||{}).parentNode : span);
if (!div) return;
//
@@ -775,7 +775,8 @@
script = scripts[i];
if (script && script.parentNode && script.MathJax.elementJax) {
jax = script.MathJax.elementJax; this.getMetrics(jax);
- jax.root.toHTML(jax.HTMLCSS.span,jax.HTMLCSS.div,this.PHASE.II);
+ if (jax.HTMLCSS.span && jax.HTMLCSS.div)
+ jax.root.toHTML(jax.HTMLCSS.span,jax.HTMLCSS.div,this.PHASE.II);
}
}
//
@@ -788,14 +789,16 @@
// Finish the math with its measured size (toHTML phase III)
//
jax = script.MathJax.elementJax; this.getMetrics(jax);
- jax.root.toHTML(jax.HTMLCSS.span,jax.HTMLCSS.div,this.PHASE.III);
- if (jax.HTMLCSS.isHidden) script.parentNode.insertBefore(jax.HTMLCSS.div,script);
- delete jax.HTMLCSS.span; delete jax.HTMLCSS.div;
- //
- // The math is now fully processed
- //
- script.MathJax.state = jax.STATE.PROCESSED;
- HUB.signal.Post(["New Math",script.MathJax.elementJax.inputID]); // FIXME: wait for this? (i.e., restart if returns uncalled callback)
+ if (jax.HTMLCSS.span && jax.HTMLCSS.div) {
+ jax.root.toHTML(jax.HTMLCSS.span,jax.HTMLCSS.div,this.PHASE.III);
+ if (jax.HTMLCSS.isHidden) script.parentNode.insertBefore(jax.HTMLCSS.div,script);
+ delete jax.HTMLCSS.span; delete jax.HTMLCSS.div;
+ //
+ // The math is now fully processed
+ //
+ script.MathJax.state = jax.STATE.PROCESSED;
+ HUB.signal.Post(["New Math",script.MathJax.elementJax.inputID]); // FIXME: wait for this? (i.e., restart if returns uncalled callback)
+ }
}
}
if (this.forceReflow) {
diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js
index 12149e059..c2cbe55de 100644
--- a/unpacked/jax/output/SVG/jax.js
+++ b/unpacked/jax/output/SVG/jax.js
@@ -228,7 +228,10 @@
// then set the role and mark it as being processed
//
jax = script.MathJax.elementJax; if (!jax) continue;
- jax.SVG = {display: (jax.root.Get("display") === "block")}
+ jax.SVG = {
+ display: (jax.root.Get("display") === "block"),
+ preview: (jax.SVG||{}).preview // in case typeset calls are interleaved
+ };
span = div = HTML.Element("span",{
style: {"font-size": this.config.scale+"%", display:"inline-block"},
className:"MathJax_SVG", id:jax.inputID+"-Frame", isMathJax:true, jaxID:this.id,
@@ -312,7 +315,7 @@
// Get the data about the math
//
var jax = script.MathJax.elementJax, math = jax.root,
- span = document.getElementById(jax.inputID+"-Frame"),
+ span = script.previousSibling;
div = (jax.SVG.display ? (span||{}).parentNode : span),
localCache = (SVG.config.useFontCache && !SVG.config.useGlobalCache);
if (!div) return;