9

Looking for a way to write the following infix binary operator, meaning "relational override":

enter image description here

18

You're lucky: the minus sign and \vartriangleleft have the same width.

\documentclass{article}
\usepackage{amssymb}

\makeatletter
\DeclareRobustCommand{\reloverrideleft}{\mathrel{\mathpalette\rel@override\vartriangleleft}}
\DeclareRobustCommand{\reloverrideright}{\mathrel{\mathpalette\rel@override\vartriangleright}}

\newcommand{\rel@override}[2]{%
  \vphantom{#2}%
  \ooalign{$\m@th#1-$\cr$\m@th#1#2$}%
}
\makeatother

\begin{document}

$A \reloverrideleft B_{\reloverrideleft}$

$A \reloverrideright B_{\reloverrideright}$

\end{document}

enter image description here

With other math fonts it may not work flawlessly, I'm afraid.

For acmart we need to clip the minus sign:

\documentclass{acmart}
\usepackage{trimclip}

\makeatletter
\DeclareRobustCommand{\reloverrideleft}{\mathrel{\mathpalette\rel@override\vartriangleleft}}
\DeclareRobustCommand{\reloverrideright}{\mathrel{\mathpalette\rel@override\vartriangleright}}

\newcommand{\rel@override}[2]{%
  \vphantom{#2}%
  \ooalign{%
    \hidewidth\clipbox*{{0.17\width} 0 {0.83\width} {\height}}{$\m@th#1-$}\hidewidth\cr
    $\m@th#1#2$\cr
  }%
}
\makeatother

\begin{document}

$A \reloverrideleft B_{\reloverrideleft}$

$A \reloverrideright B_{\reloverrideright}$

\end{document}

enter image description here

|improve this answer|||||
  • Thanks. I'm using acmart.cls, and it took me a while to figure out that I have to not import amssymb for this to render nicely (if I import amssymb the minus sign is too short). – Roly Mar 23 '17 at 13:09
  • @Roly With acmart the minus sign is a bit too long, unfortunately. – egreg Mar 23 '17 at 13:16
  • @Roly There's a reason why a mwe is always needed! – CarLaTeX Mar 23 '17 at 13:47
  • @CarLaTeX Hah, yeah. I was trying to be cute with the Detexify "spec". – Roly Mar 23 '17 at 15:39
  • @Roly Detexify is a great tool, indeed! – CarLaTeX Mar 23 '17 at 15:40
21

Package stix has it:

\documentclass{article}
\pagestyle{empty}
\usepackage{stix}
\begin{document}
$a\dsub b$
\end{document}

enter image description here

Actually texdoc comprehensive is a very good source for information like this.

|improve this answer|||||
  • Thanks! I prefer the answer above, but this is also useful. – Roly Mar 23 '17 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.