# Arrow with an asterisk superscript and text above?

I'm trying to create an arrow (or \mapsto) that has text above it and also an asterisk superscript — where the asterisk is only a superscript for the arrow, if that makes sense.

I've been trying \xmapsto{add}^*; the asterisk seems to be above for the whole thing together, which I think makes sense... but I'm wondering if there's a way I could get the asterisk to just be a superscript to the arrow as if the text wasn't there?

-

If your problem is that the argument to the extendible arrow (e.g. add) is raising the asterisk too high, you can always \smash your argument so that it takes no vertical space (e.g. using code such as $\xrightarrow{\smash{add}}^*$).

Edit. As implied by egreg in the comments, a better solution would be to use \xrightarrow{\text{add}}\mathrel{\vphantom{\to}^*}, so that the text above the arrow contributes to the height of the line without contributing to the height of the superscript. (See this duplicate question for reference.)

-
Incidentally: if you mean for add in mathmode to be the English word, then you should probably put it in text-mode, for instance by writing \xrightarrow{\textit{add}} or \xrightarrow{\smash{\textup{add}}}^* (or the like, where the macros \text?? are the same macros which modify the typeface in textmode). –  Niel de Beaudrap May 26 '11 at 8:36
Perfect!! Thank you so much. I hadn't heard of smash, but it seems that was just what I needed. –  Erik May 26 '11 at 8:45
This has the defect that the height of the text over the arrow does not contribute to the height of the line. See tex.stackexchange.com/questions/52037/enriching-to for a different solution. –  egreg Apr 16 '12 at 7:21
@egreg: good point. I've revised my answer accordingly. –  Niel de Beaudrap Apr 16 '12 at 12:31
@NieldeBeaudrap -- regarding your comment about "add" being an english word, it's more usual (and also somewhat better practice since the term is used in math mode) to use \mathit or \mathrm rather than a \text.. command. in fontmath.ltx, the font used for operator names is set by the command \DeclareSymbolFontAlphabet{\mathrm}{operators}, and operators is declared in the same file to be cmr; this morphs into \symoperators and \operator@font, used internally in the definitions for all predefined operator names in latex itself and amsmath. –  barbara beeton Apr 16 '12 at 14:17
$\stackrel{*}{\to}$ should be something to get you started :)