0

This question already has an answer here:

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.

marked as duplicate by user156344, Stefan Pinnow, Phelype Oleinik, TeXnician, Sebastiano Feb 14 at 16:14

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.

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

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:

enter image description here

  • 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 at 13:09
  • @PolianeLima That is a completely different question instead. – Raaja Feb 14 at 13:11
  • oh, i see. i am sorry. Do you know the answer? – Poliane Lima Feb 14 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 Feb 14 at 13:26

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