Create a dashed equality symbol

relation-symbolssymbols

How to create a dashed equality symbol as follows?

enter image description here

Also, make sure that, it

  • be effected by \not the same as =,
  • and act the same as = in other ways.

By the way, it's not necessary that there must be three gaps in =.

Best Answer

Here is a different solution using the trimclip package. This works with all sizes (large, Huge, etc.) as well as scriptstyle and scriptscriptstyle.

enter image description here

Instead of overlaying white onto an = sign, we clip portions of the = sign and replace with whitespace. I selected the left, middle and right 1/4 of the = sign indicated in the code as .25\weq (left quarter) followed by an eighth space (.125\weq) followed by the middle quarter (.375\weq to .625\weq), etc. You can adjust the spacing however you wish, or subdivide the = even more.

Update

Here are two additional versions where the clipping only affects one of the lines. Instead of inserting space between the segments, a clipped = symbol is inserted. When the bottom portion is clipped (\eqeqeqb) the baseline changes so a \raisebox command is used.

enter image description here

\documentclass{article}

\usepackage{trimclip}

\newlength{\weq}
\newlength{\heq}

\makeatletter
\newcommand{\eqeqeq}{\mathrel{\mathpalette\eq@eq\relax}}
\newcommand{\eq@eq}[2]{\settowidth{\weq}{$\m@th#1=$}%
    \clipbox*{0pt 0pt {.25\weq} \height}{$\m@th#1=$}%
    \hspace{.125\weq}%
    \clipbox*{{.375\weq} 0pt {.625\weq} \height}{$\m@th#1=$}%
    \hspace{.125\weq}%
    \clipbox*{{.75\weq} 0pt {\weq} \height}{$\m@th#1=$}%
}
\newcommand{\eqeqeqt}{\mathrel{\mathpalette\eq@eqt\relax}}
\newcommand{\eq@eqt}[2]{\settowidth{\weq}{$\m@th#1=$}%
    \clipbox*{0pt 0pt {.25\weq} \height}{$\m@th#1=$}%
    \clipbox*{{.25\weq} 0pt {.375\weq} {.5\height}}{$\m@th#1=$}%
    \clipbox*{{.375\weq} 0pt {.625\weq} \height}{$\m@th#1=$}%
    \clipbox*{{.625\weq} 0pt {.75\weq} {.5\height}}{$\m@th#1=$}%
    \clipbox*{{.75\weq} 0pt {\weq} \height}{$\m@th#1=$}%
}
\newcommand{\eqeqeqb}{\mathrel{\mathpalette\eq@eqb\relax}}
\newcommand{\eq@eqb}[2]{\settowidth{\weq}{$\m@th#1=$}\settoheight{\heq}{$\m@th#1=$}%
    \clipbox*{0pt 0pt {.25\weq} \height}{$\m@th#1=$}%
    \raisebox{.5\heq}{\clipbox*{{.25\weq} {.5\height} {.375\weq} {\height}}{$\m@th#1=$}}%
    \clipbox*{{.375\weq} 0pt {.625\weq} \height}{$\m@th#1=$}%
    \raisebox{.5\heq}{\clipbox*{{.625\weq} {.5\height} {.75\weq} {\height}}{$\m@th#1=$}}%
    \clipbox*{{.75\weq} 0pt {\weq} \height}{$\m@th#1=$}%
}
\makeatother

\begin{document}

$A=B_{a=b_{x=y}}$

$A\eqeqeq B_{a\eqeqeq b_{x\eqeqeq y}}$

$A\eqeqeqt B_{a\eqeqeqt b_{x\eqeqeqt y}}$

$A\eqeqeqb B_{a\eqeqeqb b_{x\eqeqeqb y}}$

$A\ne B_{a\ne b_{x\ne y}}$

$A\not\eqeqeq B_{a\not\eqeqeq b_{x\not\eqeqeq y}}$

$A\not\eqeqeqt B_{a\not\eqeqeqt b_{x\not\eqeqeqt y}}$

$A\not\eqeqeqb B_{a\not\eqeqeqb b_{x\not\eqeqeqb y}}$

\end{document}