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

Update mathml.m2 to avoid display errors in texmacs #3633

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

Corrado-possieri
Copy link

Update of the file mathml.m2 so to avoid display errors in Texmacs showing "bad mfrac" when typing fractions with negative sign.

Update development branch
@@ -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>")
Copy link
Member

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:

image

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?

Copy link
Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think I like updating mathML Minus instead. It's not just Divide objects that are giving us issues when they contain Minus objects. For example:
image

Copy link
Author

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?

Copy link
Member

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!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

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
@d-torrance d-torrance merged commit 10f2833 into Macaulay2:development Jan 23, 2025
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

Successfully merging this pull request may close these issues.

2 participants