I think the answer will be easy, but I haven't found it yet:

I use labelled arrows like \xrightarrow\tau a lot. Sometimes, I need the transitive closure of such relations, which I write \xrightarrow\tau^* but then, the star is way to high, quite above the \tau.

How can I put the star at the same height as if I had written \rightarrow^*, even when I have a label?



  • 1
    While code snippets are useful for explaining, it is best to compose a MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill Nov 22 '11 at 10:59
  • @PeterGrill: my bad. With the tag amsmath, I thought that appropriate packages were obvious, and my question is (I think/thought) orthogonal to the document class. – Axioplase Nov 22 '11 at 11:15
  • Yes it is obvious (in this case), but still takes time to type (and fix typos in my case :-)). It would just be helpful to also included the code you used to produce the image. – Peter Grill Nov 22 '11 at 11:24

$ \rightarrow^*$

$ \xrightarrow\tau{}\!\!^* $  

$ \Xrightarrow\tau* $  

enter image description here

\!\! is the same as \negthickspace


You can use \raisebox to adjust the height of the *. Here is the original and one with \raisebox:

enter image description here

I have also define a macro \myxrightarrow that you can use as \myxrightarrow{\tau} to get the same effect.


${\xrightarrow\tau}\raisebox{0.4ex}{\scriptsize *}$

  • I had something similar, but I put the \tau in the \raisebox to make it have zero height. That way, one doesn't have to guess the vertical offset (but the resulting shape might be smaller than it really is). – Andrew Stacey Nov 22 '11 at 11:05
  • use another font size and it will be funny ... – user2478 Nov 22 '11 at 14:29

Here's another version which defines a new arrow, \xrighttransarrow (maybe there's a better name ...). This is an extensible arrow modelled on the definition of \xrightarrow which makes the * a part of the arrow, rather than a decoration to be added on afterwards. There's a bit of jiggery-pokery to get the spacing right: the * has to be ignored as far as the placement of the \tau is concerned, but then it has to be taken into account when positioning the arrow with its surrounding text. I may well have messed up those bits as I'm no expert on lengths. It's also possible that it would go wrong in different maths styles.

Here's the code:


\setbox\@tempboxa\hbox{\(\scriptstyle *\)}
\newcommand{\xrighttransarrow}[2][]{\ext@arrow 0359\righttransarrowfill@{#1}{#2}\hskip\star@wd}

a\rightarrow^* b
a\xrightarrow\tau^* b
a\xrightarrow{\raisebox{0pt}[0pt][0pt]{\(\scriptstyle\tau\)}}^* b
a \xrighttransarrow\tau b

Here's the result (note that there's also another \raisebox solution in the middle there):

transitive closure arrow


Here is a simpler definition



enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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