1

Is there a symbol for \rightleftarrows (an arrow to the right above an arrow to the left) but in the style of \rightarrowtriangle (an arrow with a hollow triangular head)?

dremodaris
  • 464
  • 4
  • 13

3 Answers3

2

You can adjust the lengths in the \raisebox commands if you want the symbol at a different height or a different amount of space between. For explanations of \mathchoice and \ooalign, as well as other ways of doing this, you can look at this question and its solutions.

enter image description here

\documentclass{article}

\usepackage[only,rightarrowtriangle,leftarrowtriangle]{stmaryrd}

\newcommand{\leftrightarrowtriangle}{\mathrel{\mathchoice {\ooalign{\raisebox{-.2ex}{$\rightarrowtriangle$}\cr\raisebox{.4ex}{$\leftarrowtriangle$}\cr}} {\ooalign{\raisebox{-.2ex}{$\rightarrowtriangle$}\cr\raisebox{.4ex}{$\leftarrowtriangle$}\cr}} {\ooalign{\raisebox{-.1ex}{$\scriptstyle\rightarrowtriangle$}\cr\raisebox{.35ex}{$\scriptstyle\leftarrowtriangle$}\cr}} {\ooalign{\raisebox{-.1ex}{$\scriptscriptstyle\rightarrowtriangle$}\cr\raisebox{.3ex}{$\scriptscriptstyle\leftarrowtriangle$}\cr}} }}

\begin{document}

$A\leftrightarrowtriangle B_{A\leftrightarrowtriangle B_{A\leftrightarrowtriangle B}}$

\end{document}

Sandy G
  • 42,558
2

This is a job for \ialign rather than \ooalign.

\documentclass{article}

\usepackage{stmaryrd}

\makeatletter \newcommand{\leftrightarrowstriangle}{% \mathrel{% \mathpalette\arrowstriangle@{\leftarrowtriangle\rightarrowtriangle}% }% } \newcommand{\rightleftarrowstriangle}{% \mathrel{% \mathpalette\arrowstriangle@{\rightarrowtriangle\leftarrowtriangle}% }% } \newcommand{\arrowstriangle@}[2]{\arrowstriangle@@#1#2} \newcommand{\arrowstriangle@@}[3]{% \vbox{% \offinterlineskip \sbox\z@{$\m@th#1\rightarrowtriangle$}% \ialign{% $\m@th#1##$\cr % template #2\cr \noalign{\kern-0.4\ht\z@} #3\cr }% }% } \makeatother

\begin{document}

$A\leftrightarrowstriangle B_{A\leftrightarrowstriangle B_{A\leftrightarrowstriangle B}}$

$A\rightleftarrowstriangle B_{A\rightleftarrowstriangle B_{A\rightleftarrowstriangle B}}$

\end{document}

enter image description here

egreg
  • 1,121,712
0

The following, based on Sandy G's approach, works and is compatible with \xymatrix:

\documentclass{article}

\usepackage[only,rightarrowtriangle,leftarrowtriangle]{stmaryrd}

\newcommand{\stackedarrowstriangle}[2]{\mathrel{\mathchoice {\mathrlap{\raisebox{.35ex}{$#1$}}\raisebox{-.35ex}{$#2$}} {\mathrlap{\raisebox{.35ex}{$#1$}}\raisebox{-.35ex}{$#2$}} {\mathrlap{\raisebox{.25ex}{$\scriptstyle#1$}}\raisebox{-.25ex}{$\scriptstyle#2$}} {\mathrlap{\raisebox{.2ex}{$\scriptscriptstyle#1$}}\raisebox{-.2ex}{$\scriptscriptstyle#2$}} }}

\newcommand{\rightleftarrowstriangle}{\stackedarrowstriangle{\rightarrowtriangle}{\leftarrowtriangle}} \newcommand{\leftrightarrowstriangle}{\stackedarrowstriangle{\leftarrowtriangle}{\rightarrowtriangle}}

\begin{document}

$A\leftrightarrowtriangle B_{A\leftrightarrowtriangle B_{A\leftrightarrowtriangle B}}$

\end{document}

dremodaris
  • 464
  • 4
  • 13