diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js index da8fc5c91..e52684e03 100644 --- a/unpacked/jax/output/CommonHTML/jax.js +++ b/unpacked/jax/output/CommonHTML/jax.js @@ -2423,6 +2423,7 @@ toCommonHTML: function (node) { node = this.CHTMLdefaultNode(node,{ childNodes:["mjx-numerator","mjx-denominator"], + childOptions: {autowidth: true}, forceChild:true, noBBox:true, minChildren:2 }); var values = this.getValues("linethickness","displaystyle", @@ -2610,7 +2611,8 @@ /********************************************************/ MML.mrow.Augment({ - toCommonHTML: function (node) { + toCommonHTML: function (node,options) { + options = options || {}; node = this.CHTMLdefaultNode(node); var bbox = this.CHTML, H = bbox.h, D = bbox.d, hasNegative; for (var i = 0, m = this.data.length; i < m; i++) { @@ -2619,6 +2621,7 @@ } if (this.CHTMLlineBreaks()) { this.CHTMLmultiline(node); + if (options.autowidth) node.style.width = ""; } else { if (hasNegative && bbox.w) node.style.width = CHTML.Em(Math.max(0,bbox.w)); if (bbox.w < 0) node.style.marginRight = CHTML.Em(bbox.w); diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index 7773158cf..63f39014a 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -1296,7 +1296,7 @@ if (bbox.tw) {BBOX.tw = bbox.tw} } }, - alignBox: function (span,align,y,dx) { + alignBox: function (span,align,y,dx,noskip) { if (dx == null) {dx = 0} this.placeBox(span,dx,y); // set y position (and left aligned) if (this.msiePlaceBoxBug) { @@ -1307,7 +1307,7 @@ while (node && node.nodeName !== "#text") {node = node.previousSibling} if (node) {span.removeChild(node)} } - var bbox = span.bbox; if (bbox.isMultiline) return; + var bbox = span.bbox; if (bbox.isMultiline && !noskip) return; var isRelative = bbox.width != null && !bbox.isFixed; var r = 0, c = dx-bbox.w/2, l = "50%"; if (this.initialSkipBug) {r = bbox.w-bbox.rw-.1; c += bbox.lw} @@ -2592,8 +2592,8 @@ HTMLCSS.createRule(rule,t,0,W+2*t); HTMLCSS.placeBox(rule,0,a-t/2); } - HTMLCSS.alignBox(num,values.numalign,u); - HTMLCSS.alignBox(den,values.denomalign,-v); + HTMLCSS.alignBox(num,values.numalign,u,0,true); + HTMLCSS.alignBox(den,values.denomalign,-v,0,true); } this.HTMLhandleSpace(span); this.HTMLhandleColor(span);