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

Middle delimiter do not recognize in some cases #2663

Closed
den-low opened this issue Mar 28, 2021 · 1 comment
Closed

Middle delimiter do not recognize in some cases #2663

den-low opened this issue Mar 28, 2021 · 1 comment
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3 v3.1
Milestone

Comments

@den-low
Copy link

den-low commented Mar 28, 2021

Issue Summary

The middle delimiter do not recognize inside \left \right tex expression in some cases.

Steps to Reproduce:

Enter tex expression in MathJax demo: \left( \color{red} a \middle| \color{yellow} b \right)
and get an error message: \middle must be within \left and \right
a correct math expression is expected

Technical details:

  • MathJax Version: 3.1.2
  • Client OS: Windows 7
  • Browser: Version 89.0.4389.90 (64-bit)
@dpvc
Copy link
Member

dpvc commented Mar 29, 2021

Thanks for the report. The implementation is not sophisticated enough, it seems. I will look into it further.

A workaround for now would be to do use

\left( {\color{red} a} \middle| {\color{yellow} b} \right)

where the color is in braces so that the color command ends before the \middle is processed. (It is the presence of the color-change item in the internal parser stack that is confusing the current implementation of \middle. Ending the color before \middle eliminates that.)

@dpvc dpvc added Accepted Issue has been reproduced by MathJax team v3 labels Mar 29, 2021
@dpvc dpvc self-assigned this Mar 29, 2021
@dpvc dpvc added this to the 3.1.3 milestone Mar 29, 2021
dpvc added a commit to mathjax/MathJax-src that referenced this issue Mar 30, 2021
@dpvc dpvc removed their assignment Mar 30, 2021
dpvc added a commit to mathjax/MathJax-src that referenced this issue Apr 14, 2021
Allow \middle to work when a style or color is open.  (mathjax/MathJax#2663)
@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels Apr 14, 2021
@dpvc dpvc added Fixed v3.1 and removed Merged Merged into develop branch labels Apr 27, 2021
@dpvc dpvc closed this as completed Apr 27, 2021
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 Needed v3 v3.1
Projects
None yet
Development

No branches or pull requests

2 participants