MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

subscript of ∫ misplaced if the superscript is too deep

Open hbghlyj opened this issue 2 years ago • 1 comments

Issue Summary

If the superscript of $\int$ is so deep that it reaches the level of the subscript, the subscript will be misplaced.

MathJax $$\Large\int_0^{1+\frac1{\frac2{\frac34}}+1}+\int_0^{1+\frac1{\frac2{\frac3{\frac45}}}+1}+\int_0^{1+\frac1{\frac2{\frac3{\frac4{\frac5{\frac67}}}}}+1}+\int_0^{1+\frac{\frac{\frac{\frac{\frac{\frac76}5}4}3}2}1+1}+\int^0_{1+\frac{\frac{\frac{\frac{\frac{\frac76}5}4}3}2}1+1}$$ LaTeX (texlive) Untitled

Technical details:

  • MathJax Version: 3.2

hbghlyj avatar Aug 29 '23 12:08 hbghlyj

The issue turned out to be cause by using the box size of the subscript in place of the superscript in one place in the calculations of the positions. I have made a PR to resolve the problem.

In the meantime, you can use

MathJax = {
  startup: {
    ready() {
      const {CHTMLWrappers} = MathJax._.output.chtml.Wrappers_ts;
      CHTMLWrappers.msubsup = class myMsubsup extends CHTMLWrappers.msubsup {
        get scriptChild() {return this.supChild}
      }
      MathJax.startup.defaultReady();
    }
  }
};

as part of your configuration to correct the problem.

dpvc avatar Aug 30 '23 14:08 dpvc