3

Can anybody tell me how to use\leftrightarrows?

Besides what should I do if I insert text above and below it? Thanks.

Tahtisilma
  • 2,396
ksj03
  • 245

1 Answers1

8

If the text you want to place above and below is short then the following is one way to use them:

Sample output

\documentclass{article}

\usepackage{stackrel,amssymb}

\begin{document}

( V \stackrel[\beta]{\alpha}{\leftrightarrows} W )

\end{document}

Longer (\longleftrightarrows) and extensible (\xleftrightarrows) versions of these arrows can be made with a little effort:

Second sample output

\documentclass{article}

\usepackage{stackrel,amssymb,amsmath}

\newcommand{\leftrarrows}{\mathrel{\raise.75ex\hbox{\oalign{% $\scriptstyle\leftarrow$\cr \vrule width0pt height.5ex$\hfil\scriptstyle\relbar$\cr}}}} \newcommand{\lrightarrows}{\mathrel{\raise.75ex\hbox{\oalign{% $\scriptstyle\relbar$\hfil\cr $\scriptstyle\vrule width0pt height.5ex\smash\rightarrow$\cr}}}} \newcommand{\Rrelbar}{\mathrel{\raise.75ex\hbox{\oalign{% $\scriptstyle\relbar$\cr \vrule width0pt height.5ex$\scriptstyle\relbar$}}}} \newcommand{\longleftrightarrows}{\leftrarrows\joinrel\Rrelbar\joinrel\lrightarrows}

\makeatletter \def\leftrightarrowsfill@{\arrowfill@\leftrarrows\Rrelbar\lrightarrows} \newcommand{\xleftrightarrows}[2][]{\ext@arrow 3399\leftrightarrowsfill@{#1}{#2}} \makeatother

\begin{document}

( U \stackrel[\beta]{\alpha} \leftrightarrows V \xleftrightarrows[\text{description under}]{\text{long text}} W \stackrel[\beta]{\alpha}\longleftrightarrows X )

\end{document}

The technique is to define three parts \leftrarrows, \Rrelbar and \lrightarrows for the left, middle and right parts of the double arrow. For \longleftrightarrows we just joint these three parts together with \joinrel; for \xleftrightarrows we repeat the \Rrelbar as many times as needed to get the required width, using low-level techniques provided by the amsmath package.

To do the same for "rightleft" arrows you can use

Rightleft sample

\documentclass{article}

\usepackage{stackrel,amssymb,amsmath}

\newcommand{\rleftarrows}{\mathrel{\raise.75ex\hbox{\oalign{% $\hfil\scriptstyle\relbar$\cr \vrule width0pt height.5ex$\scriptstyle\smash\leftarrow$\cr}}}} \newcommand{\rightlarrows}{\mathrel{\raise.75ex\hbox{\oalign{% $\scriptstyle\rightarrow$\hfil\cr $\scriptstyle\vrule width0pt height.5ex\relbar$\cr}}}} \newcommand{\Rrelbar}{\mathrel{\raise.75ex\hbox{\oalign{% $\scriptstyle\relbar$\cr \vrule width0pt height.5ex$\scriptstyle\relbar$}}}} \newcommand{\longrightleftarrows}{\rleftarrows\joinrel\Rrelbar\joinrel\rightlarrows}

\makeatletter \def\rightleftarrowsfill@{\arrowfill@\rleftarrows\Rrelbar\rightlarrows} \newcommand{\xrightleftarrows}[2][]{\ext@arrow 3399\rightleftarrowsfill@{#1}{#2}} \makeatother

\begin{document}

( U \stackrel[\beta]{\alpha} \rightleftarrows V \xrightleftarrows[\text{description under}]{\text{long text}} W \stackrel[\beta]{\alpha}\longrightleftarrows X )

\end{document}

Andrew Swann
  • 95,762