Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

marked as duplicate by Tobi, Peter Jansson, Thorsten Donig, Svend Tveskæg, Ian Thompson Feb 13 at 15:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 7 down vote accepted

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

share|improve this answer

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