Skip to content

Commit 611a48c

Browse files
authored
Merge pull request #763 from mathjax/issue2800
Mark mo as not accent if used in \overset and friends. (mathjax/MathJax#2800)
2 parents 42a378e + 7dc7d0a commit 611a48c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

ts/input/tex/base/BaseMethods.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,9 @@ BaseMethods.Overset = function(parser: TexParser, name: string) {
626626
const top = parser.ParseArg(name);
627627
const base = parser.ParseArg(name);
628628
ParseUtil.checkMovableLimits(base);
629+
if (top.isKind('mo')) {
630+
NodeUtil.setAttribute(top, 'accent', false);
631+
}
629632
const node = parser.create('node', 'mover', [base, top]);
630633
parser.Push(node);
631634
};
@@ -641,7 +644,10 @@ BaseMethods.Underset = function(parser: TexParser, name: string) {
641644
const bot = parser.ParseArg(name);
642645
const base = parser.ParseArg(name);
643646
ParseUtil.checkMovableLimits(base);
644-
const node = parser.create('node', 'munder', [base, bot]);
647+
if (bot.isKind('mo')) {
648+
NodeUtil.setAttribute(bot, 'accent', false);
649+
}
650+
const node = parser.create('node', 'munder', [base, bot], {underaccent: false});
645651
parser.Push(node);
646652
};
647653

@@ -656,7 +662,13 @@ BaseMethods.Overunderset = function(parser: TexParser, name: string) {
656662
const bot = parser.ParseArg(name);
657663
const base = parser.ParseArg(name);
658664
ParseUtil.checkMovableLimits(base);
659-
const node = parser.create('node', 'munderover', [base, bot, top]);
665+
if (top.isKind('mo')) {
666+
NodeUtil.setAttribute(top, 'accent', false);
667+
}
668+
if (bot.isKind('mo')) {
669+
NodeUtil.setAttribute(bot, 'accent', false);
670+
}
671+
const node = parser.create('node', 'munderover', [base, bot, top], {accent: false, underaccent: false});
660672
parser.Push(node);
661673
};
662674

0 commit comments

Comments
 (0)