[Tex/LaTex] Type \le or \ge symbol with optional “equal” (in parentheses)

amsmathmath-moderelation-symbolssymbols

How do I type such a "less equal or just less" relation symbol:

example image

In this example it means A < 0 is equivalent to every a_j < 0 AND A \le 0 is equivalent to every a_j \le 0

Best Answer

I'd avoid such unclear symbology, to be honest.

\documentclass{article}
\usepackage{graphicx}

\makeatletter
\newcommand\opteq[1]{\mathrel{\mathpalette\opt@eq{#1}}}
\newcommand{\opt@eq}[2]{%
  \begingroup
  \sbox\z@{$#1#2$}%
  \sbox\tw@{\resizebox{!}{.5\ht\z@}{$\m@th#1($}}%
  \nonscript\hskip-\wd\tw@
  \mkern1mu
  \raisebox{-.35\ht\z@}[0pt][0pt]{\resizebox{!}{.5\ht\z@}{$\m@th#1($}}%
  \mkern-1mu
  {#2}%
  \mkern-1mu
  \raisebox{-.35\ht\z@}[0pt][0pt]{\resizebox{!}{.5\ht\z@}{$\m@th#1)$}}%
  \mkern1mu
  \nonscript\hskip-\wd\tw@
  \endgroup
}
\makeatother
\newcommand{\leoq}{\opteq{\leq}}
\newcommand{\geoq}{\opteq{\geq}}

\begin{document}

`$A < 0$' is equivalent to `$a_j < 0$, for all $j$'.

`$A \leoq 0$' is equivalent to `$a_j \leoq 0$, for all $j$'.

$A \geoq 0_{x\geoq y\leoq z}$

\end{document}

enter image description here