[Tex/LaTex] creating delimiters and inequality signs

delimiterssymbols

I would like to have a delimiter whose upper half is the upper half of the delimiter [ and whose lower half is the lower half of the delimiter ( — so that it be one continuous line,
and also the matching delimiter
whose upper half is the upper half of the delimiter ) and whose lower half is the lower half of the delimiter ] .

Correspondingly, I would like to have a binary (inequality) relation with the full-size sign > over the succession of a half-length = sign followed on the right by an empty space of the same horizontal extent as the half-length = sign, so that the the total horizontal extent of the combination of the the half-length = sign plus the empty space be the same as that of the full-size sign > . Such a binary relation could be called "greater than or half-equal to". Similarly, I would like to have a "less than or half-equal to" sign, which is a binary relation with the full-size sign < over a half-length = sign preceded on the left by an empty space of the same horizontal extent as the half-length = sign.

Can this be done without METAFONT (which I don't know at all)? Thank you very much for your help.

Best Answer

The “asymmetric” square brackets are \lfloor, \rfloor, \lceil and \rceil.

For the strange inequalities, here is some code:

\documentclass{article}
\usepackage{trimclip}

% the left half of =
\newcommand{\lhalfeq}[1]{\clipbox{0pt 0pt {.5\width} 0pt}{$#1=$}}
% the right half of =
\newcommand{\rhalfeq}[1]{\clipbox{{.5\width} 0pt 0pt 0pt}{$#1=$}}
% greater than or half-equal to
\newcommand{\gtheq}{\mathrel{\mathpalette\xgtheq\relax}}
\newcommand{\xgtheq}[2]{%
  \vcenter{\hbox{%
    \oalign{$#1>$\cr\lhalfeq{#1}\hidewidth\cr}%
  }}
}
% less than or half-equal to
\newcommand{\ltheq}{\mathrel{\mathpalette\xltheq\relax}}
\newcommand{\xltheq}[2]{%
  \vcenter{\hbox{%
    \oalign{$#1<$\cr\hidewidth\rhalfeq{#1}\cr}%
  }}
}

\begin{document}
$a\gtheq b\ltheq c$
\end{document}

enter image description here


Thanks to Heiko, a slightly better implementation for vertically centering the symbol.

\documentclass{article}
\usepackage{trimclip}

% the left half of =
\makeatletter
\newcommand{\lhalfeq}[1]{\clipbox{0pt 0pt {.5\width} 0pt}{\adjeq{#1}}}
% the right half of =
\newcommand{\rhalfeq}[1]{\clipbox{{.5\width} 0pt 0pt 0pt}{\adjeq{#1}}}

\newcommand{\adjeq}[1]{%
  \sbox0{$#1\vcenter{}$}%
  \raisebox{\dimexpr\height-2\ht0\relax}[2\dimexpr\height-\ht0\relax][0pt]{$\m@th$=}%
}
% greater than or half-equal to
\newcommand{\gtheq}{\mathrel{\mathpalette\xgtheq\relax}}
\newcommand{\xgtheq}[2]{%
  \vcenter{\hbox{%
    \oalign{$\m@th#1>$\cr\lhalfeq{#1}\hidewidth\cr}%
  }}
}
% less than or half-equal to
\newcommand{\ltheq}{\mathrel{\mathpalette\xltheq\relax}}
\newcommand{\xltheq}[2]{%
  \vcenter{\hbox{%
    \oalign{$\m@th#1<$\cr\hidewidth\rhalfeq{#1}\cr}%
  }}
}
\makeatother

\begin{document}
$a\gtheq b\ltheq c$
\end{document}

enter image description here

Related Question