198

When using the command \Rightarrow is there any way to put text above it? I have tried \overbrace but is there a way to do it without this?

0

2 Answers 2

248

The optional argument is for under:

\documentclass{article}
\usepackage{mathtools}
\begin{document}

$\xrightarrow[\text{world}]{\text{hello}}$
$\xRightarrow[\text{world}]{\text{hello}}$

\bigskip    
$\xrightarrow[g(x)]{f(x)}$
$\xRightarrow[g(x)]{f(x)}$  
\end{document}

enter image description here

2
  • 5
    This produces italicised text, so perhaps one should use a \text{} inside the arguments for "regular" text?
    – jamesh625
    Commented Sep 6, 2016 at 7:43
  • 1
    sure, it depends on what you want: a math expression or text!
    – user2478
    Commented Sep 6, 2016 at 8:54
30

Probably, you will need the amsmath package, and the commands \overset or \xrightarrow.

https://web.archive.org/web/20180705220556/http://www.stack.nl:80/~jwk/latex/examples/node6.html