Skip to content

Commit 5782ecc

Browse files
authored
Merge pull request #1975 from dpvc/issue1974
Fix problems with multline in CHTML (with tags) and SVG (with small containers). #1974
2 parents c4eca32 + a5360a0 commit 5782ecc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

unpacked/jax/output/CommonHTML/autoload/mtable.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,10 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
409409
// Set variable width on DOM nodes
410410
//
411411
if (relWidth) {
412-
this.CHTML.pwidth = values.width; this.CHTML.mwidth = CHTML.Em(TW);
413-
node.style.width = node.firstChild.style.width = "100%";
412+
node.style.width = this.CHTML.pwidth = "100%";
413+
this.CHTML.mwidth = CHTML.Em(TW);
414+
node.firstChild.style.width = values.width;
415+
node.firstChild.style.margin = "auto";
414416
}
415417
},
416418
//

unpacked/jax/output/SVG/autoload/mtable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
226226
if (values.width === "auto") {
227227
if (WP > .98) {Wf = Wp/(Wt+Wp); WW = Wt + Wp} else {WW = Wt / (1-WP)}
228228
} else {
229-
WW = SVG.length2em(values.width,mu);
229+
WW = Math.max(Wt + Wp, SVG.length2em(values.width,mu));
230230
for (i = 0, m = Math.min(J,CSPACE.length); i < m; i++) {WW -= CSPACE[i]}
231231
}
232232
// Determine the relative column widths

0 commit comments

Comments
 (0)