In this question, we try to get two unfilled triangles on top of one another, mirrored vertically, as a relation symbol. Here is what we've tried so far:
\documentclass{article}
\pagestyle{empty}
\usepackage{unicode-math}
\usepackage{mathtools}
\setmathfont{XITSMath-Regular.otf}
\usepackage{todonotes}
\newcommand{\hasTypeA}[1]{
\mathrel{\raisebox{.3ex}{\scalebox{.55}{\(\genfrac{}{}{0pt}{3}{\vartriangle}{\triangledown}\)}}}
}
\newcommand{\hasTypeB}[1]{
\mathrel{\raisebox{.3ex}{\scalebox{.55}{\(\genfrac{}{}{0pt}{3}{\triangledown}{\vartriangle}\)}}}
}
\begin{document}\noindent
\(\mathit{var}\hasTypeA\mathit{Type}\ {}^{\mathit{var}\hasTypeA\mathit{Type}}\ {}^{{}^{\mathit{var}\hasTypeA\mathit{Type}}}\)
\[\mathit{var}\hasTypeA\mathit{Type}\ {}^{\mathit{var}\hasTypeA\mathit{Type}}\ {}^{{}^{\mathit{var}\hasTypeA\mathit{Type}}}\]
\(\mathit{var}\hasTypeB\mathit{Type}\ {}^{\mathit{var}\hasTypeB\mathit{Type}}\ {}^{{}^{\mathit{var}\hasTypeB\mathit{Type}}}\)
\[\mathit{var}\hasTypeB\mathit{Type}\ {}^{\mathit{var}\hasTypeB\mathit{Type}}\ {}^{{}^{\mathit{var}\hasTypeB\mathit{Type}}}\]
\todo[inline]{%
\(\mathit{var}\hasTypeA\mathit{Type}\ {}^{\mathit{var}\hasTypeA\mathit{Type}}\ {}^{{}^{\mathit{var}\hasTypeA\mathit{Type}}}\)
\[\mathit{var}\hasTypeA\mathit{Type}\ {}^{\mathit{var}\hasTypeA\mathit{Type}}\ {}^{{}^{\mathit{var}\hasTypeA\mathit{Type}}}\]
\(\mathit{var}\hasTypeB\mathit{Type}\ {}^{\mathit{var}\hasTypeB\mathit{Type}}\ {}^{{}^{\mathit{var}\hasTypeB\mathit{Type}}}\)
\[\mathit{var}\hasTypeB\mathit{Type}\ {}^{\mathit{var}\hasTypeB\mathit{Type}}\ {}^{{}^{\mathit{var}\hasTypeB\mathit{Type}}}\]
}
\end{document}
Compiling with xelatex yields
As you see, this result suffers from several problems.
First, the two triangles are rather far apart; it would be nicer to have them a little bit closer together at least in \hasTypeA and perhaps in \hasTypeB (but not as close as in ⧖ or ⟠). Second, they don't scale in (sub)subscripts and (super)superscripts. Third, the solution works only for xelatex, and for lualatex it gets ugly, and we'd need to do something different for pdflatex anyway.
While I would probably be able to provide a huge font-dependent definition with \mathpalette, \ifxetex, \ifluatex, stmaryrd, and, if necessary, tikz, it won't be nice or simple. Is there anything universal and simple at the same time, perhaps? Or has anyone done the huge dirty job so far in their papers and would like to share their attempts?




tikzapproach because I could easily make triangles with no space buffers above/below. With normal glyphs, there is surrounding space, which can adversely affect the layout of the "stack", especially if multiple math styles (sizes) are involved. – Steven B. Segletes Jun 24 '20 at 16:01unicode-mathprecludes the use ofpdflatex. – Steven B. Segletes Jun 24 '20 at 16:04\DeclareRobustCommand, rather than\newcommand, to make\intriand\outtriwork withtodonotes. I also used a\savestackrather than\newcommandfor the underlying\uptriand\dntri. This saves having to re-render thetikzwith each use, but instead saves the typeset image in a savebox. – Steven B. Segletes Jun 24 '20 at 17:31