# How do I get filled black < and \leq?

I want to define an order relation where I to distinguish want to fill in with black so that I have a black lying triangle in the first case and a black lying triangle with the suitable line below as in \leq in the second case. I am not satisfied with \blacktriangleleft and \overset{\blacktriangleleft}{-}.

-
Some \ooalign magic together with a \leq or a raised - plus the \blacktriangleleft might work. You can search this site to see how \ooalign work. –  Manuel Jul 29 at 20:58
I attempted the search, but the hits did not seem sufficiently useful for me. –  Frode Bjørdal Jul 29 at 21:09

Here's the \ooalign black magic:

\documentclass{article}
\usepackage{amssymb}

\newcommand{\bleq}{\mathrel{\mathpalette\bleqinn\relax}}
\newcommand{\bleqinn}[2]{%
\ooalign{%
\raisebox{.2ex}{$#1\blacktriangleleft$}\cr
$#1\leq$\cr
}%
}

\begin{document}
$a\bleq b\leq c$

$\bleq_{\bleq_{\bleq}}$
\end{document}


-
Thanks! And how do you program \ble for a black <? –  Frode Bjørdal Jul 29 at 21:14
I withdraw that question, as then I use \blacktriangleleft of course. –  Frode Bjørdal Jul 29 at 21:16
@user24406 This works for the standard Computer Modern fonts; if you use a different math font, this might need a different workaround. –  egreg Jul 29 at 21:21
Your \newcommand worked well for me. I write in Tex-Studio, and am enough of a beginner to not understand the import of your invocation of fonts. –  Frode Bjørdal Jul 29 at 21:28
@user24406 If you use a package such as fourier or newtxmath for different fonts, the shape of \blacktriangleleft will not fit any more with the shape of <. But in that case you'll probably would not use the filled triangle together with <, just because they would be too different. –  egreg Jul 29 at 21:31

The following example defines \blackleq by putting \blacktriangleleft over the minus sign and vertically centers the result:

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

\makeatletter
\newcommand*{\blackleq}{%
\mathrel{%
\mathpalette\@blackleq{}%
}%
}
\newcommand*{\@blackleq}[2]{%
% #1: math style
% #2: unused
\vcenter{%
\m@th
\setbox0=\hbox{$#1\mkern3mu$}%
\setbox2=\hbox{$#1\vcenter{}$}%
\setbox4=\hbox{\raisebox{-\ht2}[.2pt][.2pt]{$#1-$}}%
\hbox{$#1\blacktriangleleft$}%
\nointerlineskip
\kern\wd0 %
\copy4 %
}%
}
\makeatother

\begin{document}
$< \blacktriangleleft \leq \blackleq \;\scriptstyle < \blacktriangleleft \leq \blackleq \;\scriptscriptstyle < \blacktriangleleft \leq \blackleq$
% Show bounding boxes
\setlength{\fboxsep}{0pt}%
\setlength{\fboxrule}{.1pt}%
$\color{red} \def\x#1{\fbox{\color{black}#1}} \x{<} \x{\blacktriangleleft} \x{-} \x{\leq} \x{\blackleq}$
\end{document}


Remarks:

• The height of the bounding box of the minus sign is much larger than the height of the minus sign. Therefore the minus sign is put into a box (4) and raised to the base line.

• \mathpalette is used to get the current math style for the size adaptations.

• It depends on the fonts, if \blacktriangleleft can be used as filled less symbol. CM fonts are ok, but the symbol is too small in MnSymbol and too small with different slopes in mathabx.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8404466509819031, "perplexity": 2127.0147805617016}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-49/segments/1416931008720.43/warc/CC-MAIN-20141125155648-00097-ip-10-235-23-156.ec2.internal.warc.gz"}