3

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?

0
8

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:

enter image description here

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