The command \rightrightarrows
(from amssymb
) draws two arrows, one on top of another. How do I get three arrows arranged in a similar fashion? An example of this (and other fancy arrow stackings) appears on page 3 of this paper, for which a source file unfortunately does not seem to be available. Commands like \stackrel
and \overset
do not size or space things properly.
5 Answers
Use \substack
$X\substack{\rightarrow\\[-1em] \rightarrow \\[-1em] \rightarrow} Y$
you can change [-1em]
to be any value as you want.
(Added by Hendrik Vogt:) With
$X \mathrel{\substack{\textstyle\rightarrow\\[-0.6ex]
\textstyle\rightarrow \\[-0.6ex]
\textstyle\rightarrow}} Y$
you get something quite close to \rightrightarrows
.
How about the following?
\newcommand\rightthreearrow{%
\mathrel{\vcenter{\mathsurround0pt
\ialign{##\crcr
\noalign{\nointerlineskip}$\rightarrow$\crcr
\noalign{\nointerlineskip}$\rightarrow$\crcr
\noalign{\nointerlineskip}$\rightarrow$\crcr
}%
}}%
}
This is basically how \overbrace
works except that it uses a fill and a \vbox
instead of a \vcenter
.
-
You could add some spacing to cause the arrows to not overlap. I didn't even notice it until just now though.– TH.Sep 3, 2010 at 8:30
-
I think you should use
\mathrel
, not\mathop
for correct spacing (\rightrightarrows
are\mathrel
). Dec 17, 2010 at 10:38 -
Use TikZ!
\documentclass{article}
\usepackage{tikz}
\newcommand{\triplerightarrow}{%
\tikz[minimum height=0ex]
\path[->]
node (a) {}
node (b) at (1em,0) {}
(a.north) edge (b.north)
(a.center) edge (b.center)
(a.south) edge (b.south);%
}
\begin{document}
\[
A \triplerightarrow B
\]
\end{document}
The minimum height=0ex
doesn't do anything. I included it to show how to increase the separation of the arrows if desired. To get longer arrows, increase the 1em
(this could be made an optional parameter, of course, and with a bit of work could be made so that there was a(nother) parameter specifying some text on top whereupon the arrows scaled to the correct length).
-
2TikZ is kind of overkill, I think, and the arrows look different from
\rightrightarrows
. Dec 17, 2010 at 10:37 -
@Hendrik: On the first point I concede, except for the fact that I tend to load TikZ for every document nowadays so as it's already there, why not use it for this construction? On the second, I don't see that much difference. The lines look a little crisper in the TikZ one at 400 magnification, and are perhaps 1pt too long (corrected with
shorten >=1pt
). If you want the arrows to touch, useinner sep=.3em
. I think that a TikZ arrow looks much better than that typeset by, say,\xrightarrow
so I'd count the discrepancy as a minus for\rightrightarrows
than the other way around. Dec 17, 2010 at 10:55 -
Well, of course it's a good question which arrow looks better. But you conceded that you do see a difference, and that was my point. If you use different arrows (e.g. the simple
\to
), then they should look the same, have the same spacing and so on. And it's quite hard to get it so close with TikZ that you can't see a difference. Dec 18, 2010 at 8:04
You can mess around with XY-pic, the \xymatrix
command in particular could be used. You might begin with the XY-pic User's Guide (pdf).
For example, if you \input xy
and \xyoption{all}
in your preamble, then
\[\xymatrix{
A\ar@<1ex>[r]\ar[r]\ar@<-1ex>[r] & B
}\]
Will produce 3 arrows from A to B.
Inspired by \threesim
in symbols-a4, which stacks three \sim
symbols, here's a solution for stacking and vertically centering a symbol three times:
\newcommand*{\triple}[2][.1ex]{%
\mathrel{\vcenter{\offinterlineskip%
\hbox{$#2$}\vskip#1\hbox{$#2$}\vskip#1\hbox{$#2$}}}}
You may use it to stack three right or left arrows or others, just a dot for example:
\newcommand*{\triplerightarrow}{\triple{\rightarrow}}
\newcommand*{\tripleleftarrow}{\triple{\leftarrow}}
\newcommand*{\tripledot}{\triple[-.6ex]{\cdot}}
Example:
$X\triplerightarrow Y\tripledot\tripleleftarrow Z$
You might adjust the spacing using the optional argument, perhaps choose another arrow with a smaller tip if you like.
unicode-math
exposes as\rightthreearrows
).