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.


2 Answers 2





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


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:


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:


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.