-
Notifications
You must be signed in to change notification settings - Fork 239
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
Update mathml.m2 to avoid display errors in texmacs #3633
Update mathml.m2 to avoid display errors in texmacs #3633
Conversation
Update development branch
M2/Macaulay2/m2/mathml.m2
Outdated
@@ -61,7 +61,7 @@ mathML FunctionApplication := m -> ( | |||
) | |||
mathML MatrixExpression := x -> concatenate( "<mrow><mo>(</mo>", mtableML x, "<mo>)</mo></mrow>", newline ) | |||
mathML Minus := v -> concatenate( "<mo>-</mo>", mathML v#0) | |||
mathML Divide := x -> concatenate("<mfrac>", mathML x#0, mathML x#1, "</mfrac>") | |||
mathML Divide := x -> concatenate("<mfrac><mrow>", mathML x#0,"</mrow>", mathML x#1, "</mfrac>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the denominator be enclosed in <mrow>
tags too?
This is kind of artificial since I'm not sure if it will ever happen by accident, but I get the following:
This is what we get with standard mode:
i1 : Divide(1, Minus 2)
1
o1 = --
-2
o1 : Expression of class Divide
Or maybe mathML Minus
should enclose everything in <mrow>
tags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that also the denominator needs to be enclosed in <mrow>
tags (it simply put the minus in the numerator).
Probably also the edit on the mathML Minus should work.
I tested it and changing mathML Minus
into
mathML Minus := v -> concatenate( "<mrow><mo>-</mo>", mathML v#0, "</mrow>")
by keeping mathML Divide
unaltered works fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it seems better. Thanks a lot.
Should I update the pull request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please -- that would be great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Updated the definition of Minus rather than the one of Divide
Update of the file mathml.m2 so to avoid display errors in Texmacs showing "bad mfrac" when typing fractions with negative sign.