TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
\newcommand\Ra{$\autorightarrow{\scriptsize{Text over arrow}}{} $}

As shown in the image, is it possible to change the gap between the arrow and the text over the arrow. Thanks for your help. enter image description here

share|improve this question
Could you update the question so that only the examples are images, as currently most of the question is also in the image. That will make it harder to search for this information in the future. – Joseph Wright Jan 27 '11 at 21:16
@Joseph - Even in the image I have the same / similar text for question. the only left out part is "As of now I can produce text as shown above, how to do as shown below " – Aku Jan 27 '11 at 21:20
up vote 3 down vote accepted

This can be done using a \raisebox with a negative value.

   \newcommand\Ra{$\autorightarrow{\scriptsize\raisebox{-1.5ex}[0pt][-1.5ex]{Text over arrow}}{} $}

Result: (old on top, new below; with surrounding \fbox)

enter image description here

share|improve this answer
Doesn't work. It just makes the enclosing box deeper, and pushes it up. – Harald Hanche-Olsen Jan 27 '11 at 20:49
Works if the optional arguments of \raisebox are used. – Martin Scharrer Jan 27 '11 at 20:57
Ah yes, I had forgotten about that. – Harald Hanche-Olsen Jan 27 '11 at 21:17
$\autorightarrow{\vbox{\hbox{\scriptsize Text over arrow}\vskip-5pt}}{} $
share|improve this answer
if possible could you please explain what \vbox & \hbox do? – Aku Jan 27 '11 at 20:53
@Aku: They are the TeX primitives for creating vertical boxes (\mpage and the minipage environment use \vbox) and horizontal boxes (\mbox is based on \hbox). I need the TeX primitives here, as the corresponding LaTeX macros do stuff that get in the way of the intended purpose in this case. – Harald Hanche-Olsen Jan 27 '11 at 20:57

I apologise if you have already considered this, but the mhchem package has excellent facilities for over-and-under annotation of a variety of arrows (left, right, resonance, equilibrium etc.), with good default spacing.

share|improve this answer

Your Answer


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.