Search code examples
javascriptmathjax

Using \x* arrows in mathjax


Does mathjax support \x* arrows? If it does, how do I use it (I'm looking for syntax and config)? If it doesn't, is there any method to get strechable arrow with text above it? The number of characters changes with every implementation and the arrow should adjust the width.

I have tried \longrightarrow and others, need longer arrows for my text.


Solution

  • MathJax's AMSmath extension includes \xrightarrow and \xleftarrow which should do what you want. Include

    <script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      TeX: {extensions: ["AMSmath.js","AMSsymbols.js"]}
    });
    </script>
    

    to load this extension (and the AMSsymbols extension as well).

    There is also an extpfeil extension that includes some other extensible symbols. See its documentation for more details.

    The extpfeil extension adds more macros for producing extensible arrows, including \xtwoheadrightarrow, \xtwoheadleftarrow, \xmapsto, \xlongequal, \xtofrom, and a non-standard \Newextarrow for creating your own extensible arrows.