Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

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.)

share|improve this answer
1  
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
1  
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
add comment

$\stackrel{*}{\to}$ should be something to get you started :)

share|improve this answer
    
Hey thanks for the comment =) What I'm trying is like, if we had \mapsto^*, how to keep that with the asterisk to the upper right of the arrow-- except for also put text above it.. –  Erik May 26 '11 at 8:03
    
Oops, i misunderstood :( I tried a couple of solutions, but I am not able to do it :( –  Helios May 26 '11 at 8:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.