Universal definition of vertically mirrored triangles on top of each other
If you want to change the gap, edit the 4pt
. If you want to change the overall height, change the {X}
to something with a different vertical footprint (possibly a \rule
expressed in ex
measurement)
\documentclass{article}
\usepackage{scalerel,stackengine,tikz}
\usetikzlibrary{shapes.geometric}
\tikzset{
uptri/.style={
draw,
ultra thick,
regular polygon,
regular polygon sides=3,
}
}
\tikzset{
dntri/.style={
draw,
shape border rotate=180,
ultra thick,
regular polygon,
regular polygon sides=3,
}
}
\savestack\uptri{\tikz{\node[uptri]{}}}
\savestack\dntri{\tikz{\node[dntri]{}}}
\DeclareRobustCommand\outtri{\mathrel{\scalerel*{%
\stackengine{4pt}{\dntri}{\uptri}{O}{c}{F}{F}{S}}{X}}}
\DeclareRobustCommand\intri{\mathrel{\scalerel*{%
\stackengine{4pt}{\uptri}{\dntri}{O}{c}{F}{F}{S}}{X}}}
\begin{document}
$x \outtri Type\qquad x \intri Type$
$\scriptstyle x \outtri Type\qquad x \intri Type$
$\scriptscriptstyle x \outtri Type\qquad x \intri Type$
\end{document}
For example, redefining the overall height to the footprint of x
rather than X
, by way of
\DeclareRobustCommand\outtri{\mathrel{\scalerel*{%
\stackengine{4pt}{\dntri}{\uptri}{O}{c}{F}{F}{S}}{x}}}
\DeclareRobustCommand\intri{\mathrel{\scalerel*{%
\stackengine{4pt}{\uptri}{\dntri}{O}{c}{F}{F}{S}}{x}}}
changes the result thus: