有没有一个符号表示\rightleftarrows
(一个向右的箭头位于向左的箭头上方),但其样式是\rightarrowtriangle
(一个带有空心三角形头部的箭头)?
答案1
\raisebox
如果您希望符号的高度或间距不同,则可以调整命令中的长度。有关\mathchoice
和的说明\ooalign
以及其他执行此操作的方法,您可以查看这个问题及其解决方案。
\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}
答案2
这是 的工作,\ialign
而不是 的工作\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}
答案3
以下内容基于 Sandy G 的方法,有效且兼容\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}