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

[v2.7.6] [TeX input] \text inside \operatorname (sometimes) left in text node #2222

Closed
pkra opened this issue Oct 18, 2019 · 4 comments
Closed
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Available v2
Milestone

Comments

@pkra
Copy link
Contributor

pkra commented Oct 18, 2019

This is a weirder one.

$$\operatorname {\text{-}}$$ leaves \text{-} in the mtext node.

But, e.g., $$\operatorname {\text{a}}$$ is fine.

Reproducible with https://cdn.rawgit.com/mathjax/MathJax/2.7.6/test/sample-dynamic-2.html.

image

@pkra
Copy link
Contributor Author

pkra commented Oct 18, 2019

This seems to be the problem:

op = op.replace(/\*/g,'\\text{*}').replace(/-/g,'\\text{-}');

does not check if * or - are already wrapped in text.

@dpvc
Copy link
Member

dpvc commented Oct 19, 2019

Yes, it looks like you have identified the culprit. I'll work on a solution.

@dpvc
Copy link
Member

dpvc commented Feb 19, 2020

I have made a PR to handle this, though it is not perfect.

dpvc added a commit that referenced this issue Feb 20, 2020
[v2] Don't add \text to operators whose name already include it.  (#2222)
@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels Feb 20, 2020
dpvc added a commit to mathjax/MathJax-test that referenced this issue Feb 22, 2020
@dpvc
Copy link
Member

dpvc commented Feb 22, 2020

In testsuite:

LaTeXToMathML/issue2222.html

dpvc added a commit to mathjax/MathJax-src that referenced this issue Mar 30, 2020
Don't add \text to operators whose names already include it. (mathjax/MathJax#2222)
@dpvc dpvc closed this as completed Apr 10, 2020
@dpvc dpvc added the Fixed label Apr 10, 2020
@dpvc dpvc removed the Merged Merged into develop branch label Sep 3, 2020
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 Fixed Test Available v2
Projects
None yet
Development

No branches or pull requests

2 participants