2

\blacktriangle gives a filled triangle symbol, but it is slightly smaller than \triangle. Is there a command that gives a filled triangle symbol whose size is exactly equal to \triangle?

If I have no choice but to use a package (other than ams packages), then could you recommand a package that does not change any other symbols and enables me to extract only that symbol?

Thank you.

1
  • Maybe alternatively you could use the smaller version for the open triangle (\vartriangle from amsmath)?
    – Marijn
    Commented Aug 23, 2022 at 9:01

1 Answer 1

1

The two symbols have slightly different shapes, but we can resize the black triangle to fit.

\documentclass{article}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{color}

\makeatletter
\newcommand{\btriangle}{\mathpalette\btriangle@\relax}
\newcommand{\btriangle@}[2]{%
  \begingroup
  \sbox\z@{$\m@th#1\triangle$}%
  \makebox[\wd\z@]{%
    \raisebox{0.04\height}{%
      \resizebox{1.1\wd\z@}{0.96\ht\z@}{%
        $\m@th#1\blacktriangle$%
      }%
    }%
  }%
  \endgroup
}
\makeatother

\begin{document}

$\triangle\btriangle\blacktriangle$

\textcolor{red}{$\btriangle$}\llap{$\triangle$}
\textcolor{red}{$\triangle$}\llap{$\btriangle$}

$\scriptstyle\triangle\btriangle$

\textcolor{red}{$\scriptstyle\btriangle$}\llap{$\scriptstyle\triangle$}
\textcolor{red}{$\scriptstyle\triangle$}\llap{$\scriptstyle\btriangle$}

\end{document}

The color package is only needed for the examples of superposition that show the greater similarity of the symbols we get.

enter image description here

You must log in to answer this question.

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