Skip to content

Commit 0d3cbfd

Browse files
authored
Merge pull request #1367 from mathjax/issue3448
Fix spacing issues with \operatorname. (mathjax/MathJax#3448)
2 parents 712294c + ce9b798 commit 0d3cbfd

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ts/core/MmlTree/MmlNode.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,8 @@ export abstract class AbstractMmlBaseNode extends AbstractMmlNode {
11821182
if (this.isEmbellished || base.isKind('mi')) {
11831183
result = base.setTeXclass(prev);
11841184
this.updateTeXclass(this.core());
1185+
} else if (base.isKind('TeXAtom')) {
1186+
this.texClass = base.texClass;
11851187
} else {
11861188
base.setTeXclass(null);
11871189
}

ts/input/tex/ams/AmsMethods.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,18 @@ export const AmsMethods: { [key: string]: ParseMethod } = {
359359
font: TexConstant.Variant.NORMAL,
360360
multiLetterIdentifiers: parser.options.ams.operatornamePattern,
361361
operatorLetters: true,
362+
noAutoOP: true,
362363
},
363364
parser.configuration
364365
).mml();
365366
//
366-
// If we get something other than a single mi, wrap in a TeXAtom.
367+
// If we get a single mi, remove the autoOp property
368+
// (it will get that automatically if more than one letter),
369+
// otherwise wrap the results in a TeXAtom.
367370
//
368-
if (!mml.isKind('mi')) {
371+
if (mml.isKind('mi')) {
372+
mml.removeProperty('autoOP');
373+
} else {
369374
mml = parser.create('node', 'TeXAtom', [mml]);
370375
}
371376
//

0 commit comments

Comments
 (0)