[Tex/LaTex] n equal sign with wider gap

symbols

I am trying to make a large unary operator from an equal sign =, namely, \mathlarger{\boldsymbol{=}}, but the bars are too close together to distinguish from the general binary case. Is there some package with = having a wider gap that I can use?

Best Answer

Here's a proposal:

\documentclass{article}
\usepackage{amsmath,xparse}

\ExplSyntaxOn
\NewDocumentCommand{\uneq}{}
 {
  \mathbin{\mathpalette\updraft_uneq:nn {}}
 }

\dim_new:N \l__updraft_width_dim
\dim_new:N \l__updraft_height_dim

\cs_new_protected:Nn \updraft_uneq:nn
 {
  \vcenter
   {
    \mathsurround=0pt
    \hbox:n
     {
      % measure the width of the equals sign in the current style
      \hbox_set:Nn \l_tmpa_box {$#1{=}$}
      \dim_set:Nn \l__updraft_width_dim { \box_wd:N \l_tmpa_box }
      % measure the width of 1mu in the current style
      \hbox_set:Nn \l_tmpa_box {$#1\mkern1mu$}
      \dim_set:Nn \l__updraft_height_dim { \box_wd:N \l_tmpa_box }
      % start drawing
      \driver_draw_begin:
      % round caps on lines
      \driver_draw_cap_round:
      % set the line width (change 1.2 to your liking)
      \driver_draw_linewidth:n { 1.2\l__updraft_height_dim }
      % 1. cm fonts use width/10  of side bearings
      % 2. the gap between lines is 5 times the line width
      % bottom line
      \driver_draw_moveto:nn
       { 0.1 \l__updraft_width_dim }
       { -2.5 \l__updraft_height_dim }
      \driver_draw_lineto:nn
       { 0.9 \l__updraft_width_dim }
       { -2.5 \l__updraft_height_dim }
      \driver_draw_stroke:
      % top line
      \driver_draw_moveto:nn
       { 0.1 \l__updraft_width_dim }
       { 2.5 \l__updraft_height_dim }
      \driver_draw_lineto:nn
       { 0.9 \l__updraft_width_dim }
       { 2.5 \l__updraft_height_dim }
      \driver_draw_stroke:
      \driver_draw_end:
      % occupy the space
      \hspace{ \l__updraft_width_dim }
     }
   }
 }
\ExplSyntaxOff

\begin{document}

$\mathbin{=}A$

$\uneq A$ $\scriptstyle\uneq A$ $\scriptscriptstyle\uneq A$

$A=B$

\end{document}

There is no “unary operator” class, one has to use \mathbin and TeX will act according to the context. You could also decide to simply use \mathord.

enter image description here