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

Fix incorrect conversion of mathtools symbols like \coloneq and \Coloneq #2418

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

fiveseven-lambda
Copy link
Contributor

Closes #2410.

Correct definitions of symbols involving colon
@dginev
Copy link
Collaborator

dginev commented Sep 20, 2024

Thank you for contributing this @fiveseven-lambda but it isn't yet finished. Could you (or should we) grep for the macros you are fixing over the entirety of latexml's Package/ directory?

For example, here is what Github finds for \coloneq:
https://github.com/search?q=repo%3Abrucemiller%2FLaTeXML%20coloneq&type=code

It would be really nice if we take this chance to sync up the Unicode output across all bindings.

@fiveseven-lambda
Copy link
Contributor Author

Regarding \coloneq, I have checked that it is also provided by txfonts and mathabx, and those implementations seem to be functioning correctly without issues. All of these use U+2254 for the symbol "≔", so it seems that the output is already consistent across these packages.
Could you provide specific instances where the same symbol is mapped to different Unicode characters? I would be happy to investigate and help ensure consistency if such cases exist.

@dginev
Copy link
Collaborator

dginev commented Sep 20, 2024

Indeed, subtle. I am mostly concerned the kind of oversight you are fixing may have happened elsewhere. It didn't help that in the original .sty packages some of the macros have matching definitions while others (intentionally) don't.

I have quickly checked the macros you've introduced, and most don't appear in existing bindings, so this PR may be good to go.

@dginev dginev self-requested a review September 20, 2024 16:21
@fiveseven-lambda
Copy link
Contributor Author

I see, thank you.
If I come across any other issues with the bindings in the future, I will make sure to report them.

@brucemiller
Copy link
Owner

brucemiller commented Sep 24, 2024

This is all rather curious. As far as I can tell, the bindings were correct when implemented. For whatever reason (mistake?), the packages txfonts, pxfonts, mathtools originally all defined \coloneq to give ":-", whereas \coloneqq gave ":=". OTOH, abxfonts, unicode-math have \coloneq giving the more intuitive ":=".

Now it seems that newtxmath which (with newtxtext) replaces txfonts has \coloneq give ":=". We don't yet have a binding for these. (txfonts remains unchanged, giving ":-").
Oddly, newtxmath does not, update \Coloneq to give "::="; it still gives "::-" (like txfonts did).

mathtools itself has been modified (in place) to redefine \coloneq as ":=". The online doc for the latter mentions it as a "breaking change Summer 2022", although that update hasn't yet propogated to my system, curiously. That change also adds the new symbols you defined \approxcolon, etc.

It's awkward for packages to introduce breaking changes, but I suppose if we interpret that ":=" was the original intention, we probably should merge your changes, right?

@brucemiller
Copy link
Owner

OK, cool, let's go with it. Thanks for the report and patch!!

@brucemiller brucemiller merged commit 4898ab2 into brucemiller:master Sep 24, 2024
13 checks passed
teepeemm pushed a commit to teepeemm/LaTeXML that referenced this pull request Oct 29, 2024
Correct definitions of symbols involving colon
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.

Incorrect conversion of mathtools symbols like \coloneq and \Coloneq
3 participants