mathjax / MathJax

Beautiful and accessible math in all browsers
http://www.mathjax.org/
Apache License 2.0
10.14k stars 1.16k forks source link

\xrightarrow does not render properly #2945

Open DerivedSkill opened 1 year ago

DerivedSkill commented 1 year ago

Issue Summary

I've tried this link to view a latex equation. Which does not rendered properly, it renders like this but it should render like this. Here mathJax 2.7.1 can render the latex perfectly.

I've also tried using MathJax version 3 by using below cdn, same things also happen there.

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

The latex was: A{\buildrel{4F}\over{ \xrightarrow[\ \ \ \ \ \ \ \ \ \ \ \ ]{}}}B

Steps to Reproduce:

  1. Use above mentioned CDN.
  2. Render above mentioned latex.

Technical details:

MathJax Configuration:

MathJax = { chtml: { mtextInheritFont: true, } };

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
dpvc commented 1 year ago

It looks like nested over-under constructions prevent the arrow from stretching. I will have to look into that further.

I'm curious, however, why you don't use something like A\xrightarrow{\ \ 4F\ \ }B rather than the more complicated construct you are using. Or perhaps A\xrightarrow{\mathmakebox[3em][c]{4F}}B if you want more exact control over the width of the arrow (provided you load the math tools package for \mathmakebox). These would work around the error you have reported.

DerivedSkill commented 1 year ago

Thanks a lot dear for your response, actually I'm not writing these latex manually, it's generated. In some cases I can't generate "A\xrightarrow{\ \ 4F\ \ }B" like this, If I generate this then other syntax will be invalid. I'm bounded to do it.

Will you please give me an idea about time-frame, when I may expect to be implemented?

dpvc commented 1 year ago

The next release will be for v4.0.0, which is currently in alpha release. There is still some work to be done on it, but I expect we may get an official release around the first of the year.

DerivedSkill commented 1 year ago

Glad to know that it's coming soon, Thanks again.

dpvc commented 1 year ago

Commit mathjax/MathJax-src#5e42b853 resolves this issue.