# To have a question mark over an arrow [duplicate]

This question already has an answer here:

I want to have a question mark over the arrow "\to". I cannot use "\limits^{?}" command because "\to" is not a mathematical operator.

How can you have a question mark over the arrow?

-

## marked as duplicate by Tobi, Peter Jansson, Thorsten Donig, Svend Tveskæg, Ian ThompsonFeb 13 '14 at 15:01

The \xrightarrow command from the amsmath package sounds like what you want.

It takes one compulsory argument, which is the text you put over the arrow, for example:

\xrightarrow{?}


will draw an arrow like \to with a question mark above it.

You can also pass an optional argument to place some text below it. For example:

\xrightarrow[!]{?}


will place a question mark above the arrow and an exclamation point below it.

The nice thing about this command is that it stretches the arrow to fit the text you give it, so if you typed

\xrightarrow{\text{This is a very long sentence}}


then it would stretch the arrow to fit.

Here's a minimal example:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

$a \xrightarrow{?} b$

$c \xrightarrow{???} d$

$e \xrightarrow[!]{???} f$

\end{document}


and the output it produces:

-