MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

\xrightarrow does not render properly

Open DerivedSkill opened this issue 3 years ago • 5 comments

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 Version: 3, 2.7.1
  • Client OS: Windows 10
  • Browser: Firefox, Chrome, Microsoft Edge

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>

DerivedSkill avatar Oct 03 '22 11:10 DerivedSkill

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.

dpvc avatar Oct 05 '22 01:10 dpvc

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?

DerivedSkill avatar Oct 12 '22 03:10 DerivedSkill

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.

dpvc avatar Oct 13 '22 01:10 dpvc

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

DerivedSkill avatar Oct 13 '22 08:10 DerivedSkill

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

dpvc avatar Dec 01 '22 18:12 dpvc