Skip to content

Commit 45b3770

Browse files
authored
Merge pull request #59 from mathjax/tall-sqrt
Better tall square roots
2 parents a92d7a2 + 7f1afcc commit 45b3770

File tree

1 file changed

+13
-1
lines changed
  • mathjax3-ts/output/chtml/Wrappers

1 file changed

+13
-1
lines changed

mathjax3-ts/output/chtml/Wrappers/msqrt.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ export class CHTMLmsqrt extends CHTMLWrapper {
5353
},
5454
'mjx-sqrt > mjx-box': {
5555
'border-top': '.07em solid'
56+
},
57+
'mjx-sqrt.mjx-tall > mjx-box': {
58+
'padding-left': '.3em',
59+
'margin-left': '-.3em'
5660
}
5761
};
5862

@@ -126,7 +130,7 @@ export class CHTMLmsqrt extends CHTMLWrapper {
126130
* @override
127131
*/
128132
public toCHTML(parent: HTMLElement) {
129-
const surd = this.childNodes[this.surd];
133+
const surd = this.childNodes[this.surd] as CHTMLmo;
130134
const base = this.childNodes[this.base];
131135
//
132136
// Get the parameters for the spacing of the parts
@@ -153,6 +157,14 @@ export class CHTMLmsqrt extends CHTMLWrapper {
153157
this.addRoot(ROOT, root, sbox);
154158
surd.toCHTML(SURD);
155159
base.toCHTML(BASE);
160+
if (surd.size < 0) {
161+
//
162+
// size < 0 means surd is multi-character. The angle glyph at the
163+
// top is hard to align with the horizontal line, so overlap them
164+
// using CSS.
165+
//
166+
SQRT.classList.add('mjx-tall');
167+
}
156168
}
157169

158170
/*

0 commit comments

Comments
 (0)