Skip to content

Commit 6aab6b2

Browse files
committed
Add missing data for vertically stretchy braces, and fix a display issue with Safari
1 parent bcf5129 commit 6aab6b2

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class CHTMLmo extends CHTMLWrapper {
6868
width: '100%'
6969
},
7070
'mjx-stretchy-h > mjx-ext > mjx-c': {
71-
transform: 'scalex(1000)'
71+
transform: 'scalex(500)'
7272
},
7373
'mjx-stretchy-h > mjx-beg > mjx-c': {
7474
'margin-right': '-.1em'
@@ -101,7 +101,7 @@ export class CHTMLmo extends CHTMLWrapper {
101101
overflow: 'hidden'
102102
},
103103
'mjx-stretchy-v > mjx-ext > mjx-c': {
104-
transform: 'scaleY(1000) translateY(.5em)'
104+
transform: 'scaleY(500) translateY(.1em)'
105105
},
106106
'mjx-mark': {
107107
display: 'inline-block',

mathjax3-ts/output/chtml/fonts/tex.ts

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -400,16 +400,26 @@ export class TeXFont extends FontData {
400400
* @param{DelimiterData} data The data for the delimiter whose CSS is to be added
401401
*/
402402
protected addDelimiterVStyles(styles: StyleList, c: string, data: DelimiterData) {
403-
const Hb = this.addDelimiterVPart(styles, c, 'beg', data.stretch[0]);
404-
this.addDelimiterVPart(styles, c, 'ext', data.stretch[1]);
405-
const He = this.addDelimiterVPart(styles, c, 'end', data.stretch[2]);
403+
const [beg, ext, end, mid] = data.stretch;
404+
const Hb = this.addDelimiterVPart(styles, c, 'beg', beg);
405+
this.addDelimiterVPart(styles, c, 'ext', ext);
406+
const He = this.addDelimiterVPart(styles, c, 'end', end);
407+
if (mid) {
408+
this.addDelimiterVPart(styles, c, 'mid', mid);
409+
styles['.MJX-TEX mjx-stretchy-v[c="' + c + '"] > mjx-ext'] = {height: '50%'}
410+
}
406411
const css: StyleData = {};
407412
if (Hb) {
408413
css['border-top-width'] = this.em0(Hb - .03);
409414
}
410415
if (He) {
411416
css['border-bottom-width'] = this.em0(He - .03);
412417
css['margin-bottom'] = this.em(-He);
418+
if (mid) {
419+
styles['.MJX-TEX mjx-stretchy-v[c="' + c + '"] > mjx-ext:last-of-type'] = {
420+
'margin-top': this.em(-He)
421+
};
422+
}
413423
}
414424
if (Object.keys(css).length) {
415425
styles['.MJX-TEX mjx-stretchy-v[c="' + c + '"] mjx-ext'] = css;
@@ -440,11 +450,12 @@ export class TeXFont extends FontData {
440450
* @param{DelimiterData} data The data for the delimiter whose CSS is to be added
441451
*/
442452
protected addDelimiterHStyles(styles: StyleList, c: string, data: DelimiterData) {
443-
this.addDelimiterHPart(styles, c, 'beg', data.stretch[0]);
444-
this.addDelimiterHPart(styles, c, 'ext', data.stretch[1], !(data.stretch[0] || data.stretch[2]));
445-
this.addDelimiterHPart(styles, c, 'end', data.stretch[2]);
446-
if (data.stretch[3]) {
447-
this.addDelimiterHPart(styles, c, 'mid', data.stretch[3]);
453+
const [beg, ext, end, mid] = data.stretch;
454+
this.addDelimiterHPart(styles, c, 'beg', beg);
455+
this.addDelimiterHPart(styles, c, 'ext', ext, !(beg || end));
456+
this.addDelimiterHPart(styles, c, 'end', end);
457+
if (mid) {
458+
this.addDelimiterHPart(styles, c, 'mid', mid);
448459
styles['.MJX-TEX mjx-stretchy-h[c="' + c + '"] > mjx-ext'] = {width: '50%'}
449460
}
450461
}

0 commit comments

Comments
 (0)