I would like to use black and white triangle arrows with text above like these:


I guess that I have to combine \longrightarrow \xrightarrow{W} and \rightarrowtriangle but I don't know how to do that.


3 Answers 3


Messing around with the code found in mathtools, which defines several types of extensible arrows on, I got the following:


  \ext@arrow 0055{\arrowfill@\relbar\relbar\rightarrowtriangle}{#1}{#2}}

        x \rightarrowtriangle y, \qquad x \xrightarrowtriangle{i} y

    Some unknown text les transitions synchrones par xyzqwert

        x \rightarrow y, \qquad x \xrightarrow{W} y


EDIT: To get filled arrows with the same shape as the empty ones, I used the \rhd (▷) and \RHD (▶) commands from wasysym:



\providecommand*\xrightarrowRHD[2][]{\ext@arrow 0055{\arrowfill@\relbar\relbar\longrightarrowRHD}{#1}{#2}}
\providecommand*\xrightarrowrhd[2][]{\ext@arrow 0055{\arrowfill@\relbar\relbar\longrightarrowrhd}{#1}{#2}}

        type               &   displaystyle                            &   textstyle                            &   scriptstyle                            \\
        filled short       & $\displaystyle a \rightarrowRHD        b$ & $\textstyle a \rightarrowRHD        b$ & $\scriptstyle a \rightarrowRHD        b$ \\
        empty  short       & $\displaystyle a \rightarrowrhd        b$ & $\textstyle a \rightarrowrhd        b$ & $\scriptstyle a \rightarrowrhd        b$ \\
        filled long        & $\displaystyle a \longrightarrowRHD    b$ & $\textstyle a \longrightarrowRHD    b$ & $\scriptstyle a \longrightarrowRHD    b$ \\
        empty  long        & $\displaystyle a \longrightarrowrhd    b$ & $\textstyle a \longrightarrowrhd    b$ & $\scriptstyle a \longrightarrowrhd    b$ \\
        filled superscript & $\displaystyle a \xrightarrowRHD{c}    b$ & $\textstyle a \xrightarrowRHD{c}    b$ & $\scriptstyle a \xrightarrowRHD{c}    b$ \\
        empty  superscript & $\displaystyle a \xrightarrowrhd{c}    b$ & $\textstyle a \xrightarrowrhd{c}    b$ & $\scriptstyle a \xrightarrowrhd{c}    b$ \\
        filled sup+super   & $\displaystyle a \xrightarrowRHD[d]{c} b$ & $\textstyle a \xrightarrowRHD[d]{c} b$ & $\scriptstyle a \xrightarrowRHD[d]{c} b$ \\
        empty  sub+super   & $\displaystyle a \xrightarrowrhd[d]{c} b$ & $\textstyle a \xrightarrowrhd[d]{c} b$ & $\scriptstyle a \xrightarrowrhd[d]{c} b$ \\

new output

They have the same behavior as \longrightarrow and friends in that they don't scale as much (at all?) as the regular arrows.

  • 1
    I like the fact that you do not use TikZ here.
    – Karlo
    Mar 29, 2016 at 11:38
  • I find it necessary to re-scale it: \providecommand\Heytingarrow{\relbar\joinrel\mathrel{\vcenter{\hbox{\scalebox{0.75}{$\rhd$}}}}} Dec 25, 2020 at 12:47

Maybe this is an overkill solution with TikZ but it is handy to use.

The code:


\begin{tikzpicture}[baseline=-0.5ex] {
\node[inner sep=0](@1) at (0,0) {#3};
\node[inner sep=0](@2) at (#5,0) {#4};
\IfBooleanTF #1 {
\draw [arrows={-Triangle[open]},shorten >= 2pt,shorten <= 2pt](@1)--(@2) node[pos=.5,above,inner sep=1pt] {#2};}
{\draw [arrows={-Triangle},shorten >= 2pt,shorten <= 2pt](@1)--(@2) node[pos=.5,above,inner sep=1pt] {#2};}}

Some text \myarrow{$x$}{$y$}, and other text.

White triangle with the starred version: \myarrow*{$x$}{$y$} and other text.

Specify the superscript as optional argument \myarrow*[$i$]{$x$}{$y$}.

Finally you can also set the distance between the two nodes: \myarrow[$i$]{$x$}{$y$}[2cm]

It works also math mode: \[ \myarrow*[$i$]{$x$}{$y$}\]

TikZ draws the content, xparse serves to define the new command called \myarrow that takes two mandatory arguments (what's on the left and on the right of the arrow respectively). The first optional argument is to typeset something centered above the arrow, while the second optional argument (i.e. after the two set of curly braces) sets the length of the arrow. The starred version \myarrow*{}{} provides the white end arrow, which can be drawn invoking the arrows.meta library. Finally the package xspace is used to deal with the space after the command.



$x \raisebox{3pt}{\underrightarrow{\quad w \quad}} y$

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .