Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MathML wrong for expression with | #150

Closed
NSoiffer opened this issue Feb 19, 2019 · 0 comments
Closed

MathML wrong for expression with | #150

NSoiffer opened this issue Feb 19, 2019 · 0 comments

Comments

@NSoiffer
Copy link
Collaborator

NSoiffer commented Feb 19, 2019

Description

The MathML for {x^2}+2x|_{x=3} is wrong:

<mrow><msup><mi extid="e842v2">x</mi><mn extid="e842v3">2</mn></msup><mo extid="e842v4">+</mo><mn extid="e842v5">2</mn><mo>&InvisibleTimes;</mo>
<mi extid="e842v6">x</mi>
<mo>&InvisibleTimes;</mo>
<msub><mo extid="e842v7">∣</mo><mrow><mi extid="e842v8">x</mi><mo extid="e842v9">=</mo><mn extid="e842va">3</mn></mrow></msub></mrow>

The &InvisibleTimes; before the subscripted | is wrong. It should get added between operands. For sub/superscripts, you should look usually look at the base and see if it is an operand or operator. In this case, | is an operator, so should not add the &InvisibleTimes;.

In various cases, when operators are prefix or postfix, they can act as an operand, but in this case, | acts like a postfix operator and should not be treated as an operand. E.g, in 3!*-4, ! is a postfix operator so that the subexpression to the left of the * is an operand. Similarly, the - (in this case) is a prefix operator, so the subexpression to the right of the * is an operand. Of course, the * is explicit multiplication, so &InvisibleTimes; doesn't need to be added. However, it would be added in an expression like 3!(-4).

@arnog arnog closed this as completed in 344dbf4 May 22, 2023
helio3197 pushed a commit to helio3197/mathlive that referenced this issue May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant