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
Merged
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion M2/Macaulay2/m2/mathml.m2
Original file line number Diff line number Diff line change
Expand Up @@ -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!

mathML OneExpression := x -> "<mn>1</mn>"
mathML ZeroExpression := x -> "<mn>0</mn>"
mathML Sum := v -> (
Expand Down
Loading