Skip to content

Commit 73c099f

Browse files
committed
Work around problem with mover where base is unusually short. Resolves issue #1657
1 parent afb499f commit 73c099f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

unpacked/extensions/TeX/mhchem3/mhchem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,4 +1690,4 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
16901690

16911691
});
16921692

1693-
MathJax.Ajax.loadComplete("[mhchem]/unpacked/mhchem.js");
1693+
MathJax.Ajax.loadComplete("[mhchem]/mhchem.js");

unpacked/jax/output/CommonHTML/jax.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,6 +2146,20 @@
21462146
var bbox = boxes[this.base], BBOX = this.CHTML;
21472147
BBOX.w = W; BBOX.h = bbox.h; BBOX.d = bbox.d; // modified below
21482148
//
2149+
// Adjust for bases shorter than the center line (#1657)
2150+
// (the center line really depends on the surrounding font, so
2151+
// it should be measured along with ems and exs, but currently isn't.
2152+
// so this value is an approximation that is reasonable for most fonts.)
2153+
//
2154+
if (bbox.h < .35) base.style.marginTop = CHTML.Em(bbox.h - .35);
2155+
//
2156+
// Use a minimum height for accents (#1706)
2157+
// (same issues with the center line as above)
2158+
//
2159+
if (values.accent && bbox.h < .431) {
2160+
base.style.marginTop = CHTML.Em(.431 - Math.max(bbox.h,.35));
2161+
}
2162+
//
21492163
// Add over- and under-scripts
21502164
//
21512165
var stack = base, delta = 0;

0 commit comments

Comments
 (0)