5

Please see the note at the end before voting to close. This is not a duplicate of the linked question and the answers there do not help with this one.

I'm looking for a symbol that goes together nicely with \triangleright, to indicate a similar but different relation. I thought that \blacktriangleright from the amssymb package would do the job, but it turns out to be a different size and shape from \triangleright:

enter image description here

Is there another symbol somewhere that looks just like \triangleright only filled in?

Alternatively, I'd be happy to take other suggestions for some other variation on the \triangleright theme that could be used to suggest another relation of the same type.

Here's the MWE:

\documentclass{article}
\usepackage{amssymb}
\begin{document}

$A\triangleright B$ vs. $A\blacktriangleright B$

\end{document}

About the supposed duplicate: I admit that the question Blacktriangleright too large with stix does sound at first glance to be similar to mine. However, that question is about how to take an existing glyph and scale it by a given amount. That would not help in my case, because \blacktriangleright is not only bigger than \triangleright, it is also a different shape. So if I would try to solve my problem by scaling \blacktriangleright I would end up with a triangle of approximately the right size but the wrong proportions and it would look bad. Consequently that question is asking for a different thing and the answers to it do not help with my question. This is not a duplicate. (Sorry for the bold text but I'm still getting close votes even after having explained this.)

7
  • 3
    Does this answer your question? Blacktriangleright too large with stix
    – Alan Munn
    Jan 2, 2023 at 6:22
  • @AlanMunn that gives a way to manually resize the symbol, but it's still not going to be the same shape as the \triangleright one. The title might sound similar but it's a completely different question.
    – N. Virgo
    Jan 2, 2023 at 6:43
  • 2
    This doesn't answer your question, but amssymb defined \vartriangleright which has the same dimensions as \blacktriangleright. So perhaps you could use that instead of \triangleright?
    – Slurp
    Jan 2, 2023 at 7:57
  • @Slurp that's helpful - I could use that, but I do prefer the look of \triangleright.
    – N. Virgo
    Jan 2, 2023 at 8:35
  • Why is this attracting close votes? I've explained why the other answer doesn't help. (It really doesn't!)
    – N. Virgo
    Jan 2, 2023 at 10:23

1 Answer 1

7

You can resize \blacktriangleright to match \triangleright (with a small horizontal shift).

In the code below I assume that what you want are relation symbols, notwithstanding that \triangleright is classed as operation symbol.

\documentclass{article}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{xcolor}% just for the final comparison

\makeatletter
\newcommand{\tleft}{\mathrel\triangleleft}
\newcommand{\tright}{\mathrel\triangleright}
\DeclareRobustCommand{\btleft}{\mathrel{\mathpalette\btlr@\blacktriangleleft}}
\DeclareRobustCommand{\btright}{\mathrel{\mathpalette\btlr@\blacktriangleright}}

\newcommand{\btlr@}[2]{%
  \begingroup
  \sbox\z@{$\m@th#1\triangleright$}%
  \sbox\tw@{\resizebox{1.1\wd\z@}{1.1\ht\z@}{\raisebox{\depth}{$\m@th#1\mkern-1mu#2$}}}%
  \ht\tw@=\ht\z@ \dp\tw@=\dp\z@ \wd\tw@=\wd\z@
  \copy\tw@
  \endgroup
}

\begin{document}

$A \tright B \btright C$ $A\tleft B\btleft C$

$A \btright B \tright C$ $A\btleft B\tleft C$

{\ooalign{$\tright$\cr\color{red}$\btright$\cr}}
{\ooalign{$\btright$\cr\color{red}$\tright$\cr}}

{\ooalign{$\scriptstyle\tright$\cr\color{red}$\scriptstyle\btright$\cr}}
{\ooalign{$\scriptstyle\btright$\cr\color{red}$\scriptstyle\tright$\cr}}


{\fboxsep=0pt \fboxrule=0.1pt \fbox{$\tright$} \fbox{$\btright$}}

\end{document}

enter image description here

The comparison with the different colors shows that the superimposition is not really perfect, but the differences are really tiny and not noticeable when the symbols are separate.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .