So I know the cancel package lets you put a diagonal arrow through text in Math mode, but how could I achieve the same result but with a horizontal arrow?

  • The result doesn't seem pretty: the arrow tip will confuse with the text underneath.
    – egreg
    Commented Nov 24, 2015 at 21:59
  • @egreg I'm imaging an image that, if I try to approximate it with ASCII, would look like: x -f-u-n-c-t-i-o-n-> y. Of course I don't always want the text that is overlapping with arrow to be 'function' but this gives a sense of what I want it to look like. But the arrow-head should stick out some distance to the right of the text so that there isn't that confusion.
    – Addem
    Commented Nov 24, 2015 at 23:13

1 Answer 1


Maybe something like this, using \xrightarrow:


       \hidewidth\box0 \hidewidth\cr




enter image description here

  • I'm playing around with it and can't figure out how I might automatically make the arrow head extend just a little farther to the right. I know I can do it if I use the command \arrowcancel{abc\,\,} but is there a way to automate this effect?
    – Addem
    Commented Nov 24, 2015 at 23:31
  • 1
    @Addem Change \mspace{6mu} into \mspace{9mu} or so.
    – egreg
    Commented Nov 24, 2015 at 23:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .