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

[v3, v4] TeX parsing error \operatorname {\mathsf{f-tors}}A #3038

Open
pkra opened this issue Apr 26, 2023 · 2 comments
Open

[v3, v4] TeX parsing error \operatorname {\mathsf{f-tors}}A #3038

pkra opened this issue Apr 26, 2023 · 2 comments
Labels
Accepted Issue has been reproduced by MathJax team Merged Merged into develop branch Test Needed v3 v4

Comments

@pkra
Copy link
Contributor

pkra commented Apr 26, 2023

The expression \operatorname {\mathsf{f-tors}}A gives me a parsing error.

In the browser (with a fairly recent v4 build), it's something like "e.string.substr(...).match(...) is null"

In node (on something close to v4-alpha):

mathjax-full/js/input/tex/ParseMethods.js:40
            c = parser.string.substr(parser.i - 1).match(env.multiLetterIdentifiers)[0];
                                                                                    ^

TypeError: Cannot read properties of null (reading '0')

It seems to come down to just the - inside the mathsf (or some other font variant), i.e., a more minimal example is \operatorname {\mathsf{-}}.

For completeness, this works fine in "real" LaTeX.

@dpvc
Copy link
Member

dpvc commented Apr 26, 2023

I've made a PR to resolve the issue. It had to do with conflicting uses of a pattern for multi-character identifiers that is different for \operatorname and \mathsf. Thanks for the report.

@pkra
Copy link
Contributor Author

pkra commented Apr 26, 2023

Thanks so much!

dpvc added a commit to mathjax/MathJax-src that referenced this issue May 4, 2023
Handle dash during font-change in `\operatorname`. (mathjax/MathJax#3038)
@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team Merged Merged into develop branch Test Needed v3 v4
Projects
None yet
Development

No branches or pull requests

2 participants