# \rightsquigarrow with the text above and below it [duplicate]

is it possible to write a text above and below the \rightsquigarrow? I am trying \xrightsquigarrow[\text{b}]{\text{a}}, but it is not working.

• Welcome to TeX.SE! This may help. – user156344 Feb 14 '19 at 12:51
• @JouleV, I don't see how it could help. The OP wants arrows not operators. – Sigur Feb 14 '19 at 12:56
• @Sigur My answer on that question works for everything, not only operators. – user156344 Feb 14 '19 at 12:57
• @JouleV, you don't mention \overset{} there. I suppose you suggest $\underset{b}{\overset{a}{\rightsquigarrow}}$. – Sigur Feb 14 '19 at 13:02

You can define a new command to achieve it using:

\documentclass{article}
\usepackage{amssymb}
\usepackage{stackengine}
%https://tex.stackexchange.com/questions/123219/writing-above-and-below-a-symbol-simultaneously
\newcommand\stackrqarrow[2]{%
\mathrel{\stackunder[2pt]{\stackon[4pt]{$\rightsquigarrow$}{$\scriptscriptstyle#1$}}{%
$\scriptscriptstyle#2$}}}
\begin{document}
$x \stackrqarrow{a}{b} y$
\end{document}


to get:

• thanks. it works. however the lenght of the arrow does not grows according to the lenght of the text above/below, differently of the case of \xrightarrow{\text{a}}{\text{a}}. – Poliane Lima Feb 14 '19 at 13:09
• @PolianeLima That is a completely different question instead. – Raaja_is_at_topanswers.xyz Feb 14 '19 at 13:11
• oh, i see. i am sorry. Do you know the answer? – Poliane Lima Feb 14 '19 at 13:24
• @PolianeLima If you can post it as a new question, I or someone else can try to answer it. If you prefer TikZ way of doing it, then it is definitely possible ;) – Raaja_is_at_topanswers.xyz Feb 14 '19 at 13:26