14

How can I label $\rightleftarrows$ above the top arrow and below the bottom arrow?

17

I don't know which package defines \rightleftarrows but this shows how to get labels over and under one of the standard arrows.

Edit updated to use the requested arrow

\documentclass{article}

\usepackage{amssymb}

\begin{document}

\[a \mathrel{\mathop{\rightleftarrows}^{\mathrm{over}}_{\mathrm{under}}} b\]

\end{document}

enter image description here

  • 1
    That would be amssymb. – percusse Apr 8 '12 at 11:01
  • 1
    @percusse ah thanks I should have known that:-) updated answer – David Carlisle Apr 8 '12 at 11:10
  • Is there a way to this not in amssymb? Because my work is on Wordpress, and I either use their built-in Latex or mathurl.com, neither of which support amssymb I am sure. Sorry to trouble you. – j4fj49 Apr 8 '12 at 12:23
  • the code for the under and over label does not use any package at all, \mathrel and \mathop are primitives and \mathrm is standard LaTeZ (or you could use \rm in plain TeX) So if you can use the arrow in wordpress you should be able to use labels too. But you need something to define the arrow as it is not built in to latex. – David Carlisle Apr 8 '12 at 12:27
  • I guess that means that Wordpress supports some sort of package because that arrow showed up. – j4fj49 Apr 8 '12 at 12:31
5

If you want an extensible arrow, you can use the trick found in Herber Voß's Mathmode (texdoc mathmode or http://texdoc.net/pkg/mathmode):

\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newcommand\xleftrightarrow[2][]{\ext@arrow 0099{\longleftrightarrowfill@}{#1}{#2}}
\def\longleftrightarrowfill@{\arrowfill@\leftarrow\relbar\rightarrow}
\makeatother
\begin{document}
$a\xleftrightarrow[under]{over}b$
\end{document}

enter image description here

  • I added a link to texdoc.net because I didn't seem to be able to get Mathmode on my MiKTeX 2.9, hope that's alright. – doncherry Apr 8 '12 at 13:10
  • And congratulations to your answer No. 2000! I'll be lucky if I can keep my own rep to about a tenth of yours :) – doncherry Apr 8 '12 at 14:31
4

I found a simple solution that works for me:

A \overset{F}{\underset{G}\rightleftarrows} X 
  • Works well with the js parsers too! – Richard Ambler Aug 27 '18 at 9:59
0

You can also consider using \stackrel

\stackrel{\rm{1:1}}{\rightarrow}
0

I experienced a similar problem and wasn't getting a satisfying answer. The problem is that the length of the arrows should "grow" with the text, or, at least, it should be possible to set the length manually. Finally, I found a solution for the last option (the first one not yet solved).

\stackrel[\mathrm{discharge}]{\mathrm{charge}}{\overrightarrow{\underleftarrow{\hspace{2cm}}}}

The 2 cm can be changed as needed, the word above the arrow are "charge" and below "discharge"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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