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

subtle? poor translation from TeX #2775

Closed
NSoiffer opened this issue Sep 21, 2021 · 2 comments
Closed

subtle? poor translation from TeX #2775

NSoiffer opened this issue Sep 21, 2021 · 2 comments
Labels
Expected Behavior This is how MathJax works v3

Comments

@NSoiffer
Copy link

Issue Summary

I suspect that there is nothing that can be done, but I felt I should mention this because it does have accessibility implications.

If an author groups the base of a subscript (and likely superscript), the translation from TeX fails to group the base into a single mi in a case like {GL}_2. I doubt many TeX authors would even try to indicate that the base is "GL", but if the author makes an effort to provide some "semantics", the translator should respect that. I also tried \rm{GL}_2" -- it doesn't do any better.

The ClearSpeak translation ends up "G of L sub 2" instead of "GL sub 2"

The Nemeth code uses two capitalization indicators (one before the G and one before the L) instead of a leading double capitalization indicator.

FYI: this came from sre-tests/output/nemeth/AataNemeth.html # 246 where the output is wrong (should use double capitalizaiton indicator as it does with # 241).

Technical details:

@dpvc
Copy link
Member

dpvc commented Sep 23, 2021

As you say, trying to decide whether {GL}_2 should be separate mi elements for G and L or a single one containing both is not easy. Note, however, that your example \rm{GL}_2 is not correct (or at least not what I think you intend), as \rm doesn't take an argument; it is a switch that turns the font to roman from then on (so in your example, it applies to the 2 as well as anything else that follows, and the braces are redundant). You may have meant {\rm GL}_2, but I don't consider this to be semantic as the \rm is changing the font style, not providing a meaning.

Did you mean \mathrm{GL}_2 instead? As it turns out, MathJax does code \mathrm{GL}_2 using a single mi for both letters. This was the result of a discussion in issue #2595 where \mathbf, \mathrm, and similar macros are handled specially so that letter groups in their arguments are combined into a single mi, as will occur in your example. Personally, I still don't consider the use of \mathrm, etc., to be semantic, but apparently some do.

There is also \operatorname{GL}_2 that actually is semantic, and does produce a single mi, when possible. Finally, \mathop{\rm GL}\nolimits_2 also produces a single mi (as a special case), since this also suggests a semantic interpretation.

The \mathrm handling is new in v3.1, but the \operatorname and \mathop treatment is also in v2.

@dpvc dpvc added Expected Behavior This is how MathJax works v3 labels Sep 23, 2021
@dpvc dpvc closed this as completed Mar 11, 2022
@NSoiffer
Copy link
Author

I thought I had replied earlier, but apparently I never clicked on the "comment" button.

At this point, I just want to record a "thank you" for your reply. Indeed I should have/meant to use mathrm{GL}_2 and perhaps should have used \operatorname (which I wasn't familiar with).

I agree that closing this issue is appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expected Behavior This is how MathJax works v3
Projects
None yet
Development

No branches or pull requests

2 participants