Skip to content

Commit b5389e0

Browse files
authored
Merge pull request #1795 from dpvc/issue1657
Fix problem with <=> arrow in mhchem. 1657
2 parents c8e3bf5 + 86ad973 commit b5389e0

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
@@ -2155,6 +2155,20 @@
21552155
var bbox = boxes[this.base], BBOX = this.CHTML;
21562156
BBOX.w = W; BBOX.h = bbox.h; BBOX.d = bbox.d; // modified below
21572157
//
2158+
// Adjust for bases shorter than the center line (#1657)
2159+
// (the center line really depends on the surrounding font, so
2160+
// it should be measured along with ems and exs, but currently isn't.
2161+
// so this value is an approximation that is reasonable for most fonts.)
2162+
//
2163+
if (bbox.h < .35) base.style.marginTop = CHTML.Em(bbox.h - .35);
2164+
//
2165+
// Use a minimum height for accents (#1706)
2166+
// (same issues with the center line as above)
2167+
//
2168+
if (values.accent && bbox.h < CHTML.TEX.x_height) {
2169+
base.style.marginTop = CHTML.Em(CHTML.TEX.x_height - Math.max(bbox.h,.35));
2170+
}
2171+
//
21582172
// Add over- and under-scripts
21592173
//
21602174
var stack = base, delta = 0;

0 commit comments

Comments
 (0)