Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions testsuite/tests/input/tex/Base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12198,6 +12198,33 @@ describe('Character Class Changes', () => {

/********************************************************************************/

it('Mathop Apply', () => {
toXmlMatch(
tex2mml('\\mathop{F} x'),
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\mathop{F} x" display="block">
<mrow data-mjx-texclass="OP" data-latex="\\mathop{F}">
<mi data-latex="F">F</mi>
</mrow>
<mo data-mjx-texclass="NONE">&#x2061;</mo>
<mi data-latex="x">x</mi>
</math>`
);
});

/********************************************************************************/

it('Mathop No Apply', () => {
toXmlMatch(
tex2mml('\\mathop{} x'),
`<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\\mathop{} x" display="block">
<mrow data-mjx-texclass="OP" data-latex="\\mathop{}"></mrow>
<mi data-latex="x">x</mi>
</math>`
);
});

/********************************************************************************/

it('Mathrel', () => {
toXmlMatch(
tex2mml('\\mathrel{R}'),
Expand Down
7 changes: 7 additions & 0 deletions ts/input/tex/base/BaseItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,13 @@ export class FnItem extends BaseItem {
return [[top, item], true];
}
}
// @test Mathop Apply, Mathop No Apply
if (
top.isKind('TeXAtom') &&
top.childNodes[0]?.childNodes?.length === 0
) {
return [[top, item], true];
}
// @test Named Function, Named Function Arg
const node = this.create(
'token',
Expand Down