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)?
- 464
- 4
- 13
-
You can stack the arrows yourself: https://www.ctan.org/pkg/stackengine – samcarter_is_at_topanswers.xyz Aug 29 '23 at 13:53
3 Answers
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.
\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}
- 42,558
-
This solution does not work inside of an
\xymatrix, probably due to the usage of\cr. – dremodaris Sep 11 '23 at 17:25
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}
- 1,121,712
-
I'm accepting Sandy G's answer for being comprehensible and editable without far-reaching LaTeX expertise. – dremodaris Sep 01 '23 at 12:09
-
1@dremodaris If you like to dig holes with a fork and roll spaghetti with a spade… – egreg Sep 01 '23 at 12:40
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}
- 464
- 4
- 13

