How can regular text and/or MathJax be positioned directly atop a MathJax symbol?

Example: https://tex.stackexchange.com/questions/85113/xrightarrow-text. The code there seems bootless on MSE?

Another (Abortive) Example : ${\mapsto}^{\text{text} \int} \qquad$ (Code : {\mapsto}^{\text{text} \int}).

\mathops{\mapsto}^{\text{text} \int} also fails.

up vote 8 down vote accepted

$\overset{\mbox{This?}}{\longrightarrow}$

$\overset{\mbox{This?}}{\longrightarrow}$

If you want the arrow to stretch with the size of the text on top, try

$\xrightarrow{\text{text}\int}$

which produces: $\xrightarrow{\text{text}\int}$.

To get your original attempt to work in in-line math mode, you need to use \limits to force the superscript into the overset position:

$\mathop{\longmapsto}\limits^{\text{text}\int\strut}$

which produces $\mathop{\longmapsto}\limits^{\text{text}\int\strut}$, but the arrow here won't stretch. I've added a \strut to give a little extra space between the arrow and text.

To get a stretchy arrow, you could use the non-standard \Newextarrow command from the extpfeil extension:

$\require{extpfeil}\Newextarrow{\xmapsto}{5,5}{0x27FC}$
$\xmapsto{\text{text}\int}$

which gives $\require{extpfeil}\Newextarrow{\xmapsto}{5,5}{0x27FC}$ $\xmapsto{\text{text}\int}$. Note that the first expression only needs to be done once.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .