Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

There is \rightrightarrows to produce two parallel arrows, \longrightarrow to produce a longer arrow and \xrightarrow to produce an extendable arrow. But is there an easy way to produce two long parallel arrows (say \longrightrightarrows) and two extendable parallel arrows (say \xrightrightarrows)?

I have tried to use \atop, \overset, \underset, but it's always imperfect. Using \atop, the distance between the two parallel arrows are too large. Using \overset, the length of the two parallel arrows are different. More generally, what I need are: one can change the length of arrows, the distance betweens the arrows and it should be symmetrical with respect to default vertical position. Also, it should can be typed in both inline math mode and display math mode. And if it can be typed in mathoverflow, it would be great. (In the site mathoverflow, one can't not use \xymatrix....)

The examples looks like:

share|improve this question

migrated from stackoverflow.com Aug 6 '11 at 18:19

This question came from our site for professional and enthusiast programmers.

    
tex.stackexchange.com/questions/2656/… has some info. –  Caramdir Aug 6 '11 at 18:28
    
Would a double-lined extensible arrow work? These are provided in the form of \xLongrightarrow{abc} by the extarrows package. –  Werner Aug 6 '11 at 18:59
    
Try the mathtools package. –  mbork Aug 6 '11 at 19:04
add comment

2 Answers 2

up vote 4 down vote accepted

I wrote the extpfeil package, which allows creating new extensible arrow types (using the same mechanism which amsmath uses internally for its build-in arrows).

With this, you can write once

\newextarrow{\xbigtoto}{{20}{20}{20}{20}}
   {\bigRelbar\bigRelbar{\bigtwoarrowsleft\rightarrow\rightarrow}}

and then:

$ A \xbigtoto[d_1]{d_2} B $

This will be included in the next version of the package - but I'm not sure when this will be. (You can grab it from Github, though.) This is a screenshot from the package documentation:

screenshot

The package does not yet provide support for three parallel arrows – you would need something analogous to \bigRelbar which draws three lines, and something analogous to \bigtwoarrowsleft which draws three arrows.

share|improve this answer
add comment
\documentclass[a4paper]{article}
\usepackage{amsmath}

\makeatletter
\newcommand*{\doublerightarrow}[2]{\mathrel{
  \settowidth{\@tempdima}{$\scriptstyle#1$}
  \settowidth{\@tempdimb}{$\scriptstyle#2$}
  \ifdim\@tempdimb>\@tempdima \@tempdima=\@tempdimb\fi
  \mathop{\vcenter{
    \offinterlineskip\ialign{\hbox to\dimexpr\@tempdima+1em{##}\cr
    \rightarrowfill\cr\noalign{\kern.5ex}
    \rightarrowfill\cr}}}\limits^{\!#1}_{\!#2}}}
\newcommand*{\triplerightarrow}[1]{\mathrel{
  \settowidth{\@tempdima}{$\scriptstyle#1$}
  \mathop{\vcenter{
    \offinterlineskip\ialign{\hbox to\dimexpr\@tempdima+1em{##}\cr
    \rightarrowfill\cr\noalign{\kern.5ex}
    \rightarrowfill\cr\noalign{\kern.5ex}
    \rightarrowfill\cr}}}\limits^{\!#1}}}
\makeatother

\begin{document}
$A\doublerightarrow{a}{bcdefgh}B$

$A\triplerightarrow{d_0,d_1,d_2}B$
\end{document}

Double and triple right arrow

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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