# [CommonHTML] Poor over script position above italic letters #1735

Closed
opened this issue Apr 14, 2017 · 6 comments

Projects
None yet
3 participants

### Issue Summary

Over script characters that are positioned above italic characters appear too far to the right, as if the italic correction is not handled properly.

### Steps to Reproduce

1. Load the following HTML example page.
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=MML_CHTML">
</script>

<math xmlns="http://www.w3.org/1998/Math/MathML" mathsize="36pt">
<mover>
<mrow>
<mi>X</mi>
<mo>&#x2063;</mo>
<mi>J</mi>
</mrow>
<mo>&#x23dc;</mo>
</mover>
<mo>=</mo>
<mover>
<mrow>
<mtext mathvariant="italic">X</mtext>
<mo>&#x2063;</mo>
<mtext mathvariant="italic">J</mtext>
</mrow>
<mo>&#x23dc;</mo>
</mover>
[/itex]

1. Observe the horizontal position of the over script character in relation to the italic base letters.

This is a bug because the extent of the over script character should match the extent of the base letters, after accounting for the italic slant of the characters. The over script extends too far to the right, especially for the case on the left that uses mi elements.

### Technical details

• MathJax Version: 2.7.0 release
• Client OS: Windows
• Browser: Chrome

Member

### pkra commented Apr 16, 2017

 Thanks for the report. I can reproduce this with the CommonHTML output on Chrome and Firefox.

Member

### dpvc commented Apr 16, 2017

 I believe the problem is this line, which bubbles the accent skew up from lower nodes to higher nodes. The skew value is only supposed to be used if base is a single character, but this propagates the skew value for all cases. I think  if (cbox.skew && this.data.length === 1) bbox.skew = cbox.skew;  would do the trick.
Author

### samdooley commented Apr 17, 2017

 Thanks for the patch. I was able to test it with a local 2.7.0 and it is better, but I believe the line above needs the same treatment. So I think:  if (cbox.ic && this.data.length === 1) {bbox.ic = cbox.ic} else {delete bbox.ic} if (cbox.skew && this.data.length === 1) bbox.skew = cbox.skew;  does the trick, both for arc(XJ) and arc(XY).

Merged

Member

### dpvc commented Jul 7, 2017

 The issue1735 branch of my fork of MathJax includes a fix for this.

### dpvc added a commit that referenced this issue Jul 10, 2017

 Merge pull request #1787 from dpvc/issue1735 
Improve position of stretchy accents.  #1735
 122c427 

Member

### dpvc commented Jul 10, 2017

 ==> Merged.

### dpvc pushed a commit to mathjax/MathJax-test that referenced this issue Jul 15, 2017

 Add test for mathjax/MathJax#1735 
 db40528 
Member

### dpvc commented Jul 15, 2017

 ==> In testsuite MathMLToDisplay/Presentation/ScriptsAndLimits/mover/issue1735.html