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

small problems with menclose #2571

Closed
NSoiffer opened this issue Nov 20, 2020 · 2 comments
Closed

small problems with menclose #2571

NSoiffer opened this issue Nov 20, 2020 · 2 comments
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3 v3.1
Milestone

Comments

@NSoiffer
Copy link

Issue Summary

There are some issues with positioning and length of 'strikes' arrows in menclose.

Also, RTL direction is not being handled (an issue only if RTL is meant to be handled).

Description:

Position and Length

Overall, there are some small rendering errors with the positioning of the strikes and arrow notation values. There are a few that are larger. You can see the contrast in the following. In the first example below, the arrows are close to correct -- the lines should go through the center of the '+' and through the division line as those are the centerpoint of the box. Within a subpixel, these are correct (shown zoomed at 200% to make it easier to see, but it is off at 100% also):
image

A problem with the above rendering is that the diagonal arrows are a little short and don't reach the box around the contents; the horizontal and vertical lines do touch the box.

If only left or right is given (as opposed to box which is both left and right), the position is worse:
image

I believe the problem occurs because the border padding is only added on one side. The positioning of the vertical line/arrow should not be affected by other decorations (as per the spec).

A similar problem happens with the horizontal positioning and top and bottom:
image

RTL

I didn't see anything in the MathJax docs that said MathJax supports right-to-left rendering. If it does, then you missed support of it on menclose. Here are three cases that should switch according to the spec:
image

Technical details:

I have put a large suite of test examples in codepen. It is using MathJax (see the JS section for details)

  • MathJax Version: 3.1.2 (CHTML Output Jax)
  • Happens with Chrome and Firefox.

Kudos:

I discovered these problems when working on a polyfill for MathML Core. I used the clever ideas for drawing the pieces with CSS borders in my polyfill. A big round of applause to whomever came up the CSS for drawing the arrowheads! I wouldn't have thought you could do that if I hadn't seen it written down.

@dpvc
Copy link
Member

dpvc commented Dec 1, 2020

Thanks for the report. You are correct that the misplacement is due to the change in size on one side only. I will look into how to resolve that.

For 19 and 20, do you mean that the arrow should be on the fraction line (not the center of the plus)?

We don't currently support RTL, but would like to in the future.

Thanks also for the kudos. The arrows are my doing. I was pleased that I was able to do all the enclosures with CSS, and didn't have to resort to SVG as I did in v2.

@dpvc dpvc added Accepted Issue has been reproduced by MathJax team v3 labels Dec 1, 2020
@NSoiffer
Copy link
Author

NSoiffer commented Dec 1, 2020

You are correct that the the text for 19 and 20 is incorrect -- copy/paste that wasn't updated. I'll fix up the codepen.

@dpvc dpvc added this to the 3.1.3 milestone Jan 31, 2021
@dpvc dpvc self-assigned this Jan 31, 2021
dpvc added a commit to mathjax/MathJax-src that referenced this issue Mar 25, 2021
@dpvc dpvc removed their assignment Mar 25, 2021
@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels Apr 8, 2021
dpvc added a commit to mathjax/MathJax-src that referenced this issue Apr 8, 2021
Fix issues with placement of menclose notations. (mathjax/MathJax#2571)
@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