2

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 =.

4
  • 2
    It is possible to construct such a symbol (also \notable), but maybe another more common symbol is better suited. What do you want to express with the symbol? Maybe use \stackrel?=?
    – gernot
    Aug 7, 2021 at 20:09
  • 1
    what length is that? the same as = or the same as ==== or something in between? Aug 7, 2021 at 21:09
  • 1
    ⩶ is U+2A76 which is \eqeqeq in unicode-math, stix and stix2 packages. Aug 7, 2021 at 21:13
  • @DavidCarlisle The same as =.
    – M. Logic
    Aug 8, 2021 at 4:25

2 Answers 2

4

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}
8
  • Thanks very much!
    – M. Logic
    Aug 10, 2021 at 4:51
  • Could you use this way to give a equality symbol which has only one dashed line not two?
    – M. Logic
    Aug 16, 2021 at 13:54
  • @M.Logic: Yes. Just change = to - in the expression $\m@th#1=$ (4 times)
    – Sandy G
    Aug 16, 2021 at 14:47
  • Maybe I didn't speak clearly. What I mean to is a symbol with two lines but there is only one dashed line.
    – M. Logic
    Aug 16, 2021 at 15:17
  • @M.Logic: Oh, I misunderstood. Do you want the top line or the bottom to be dashed?
    – Sandy G
    Aug 16, 2021 at 17:21
6

You can make your own symbol using the techniques from this post. Here is a version using \ooalign to superimpose two white rules on an = symbol to make the dash pattern. You can adjust the spacing and thickness of the gaps to your liking by changing the arguments in \hspace and \rule. Note that if your page color is not white you'll have to change the color of the rules.

enter image description here

\documentclass{article}

\usepackage{color} %for \textcolor

\newcommand{\eqeqeq}{\mathrel{\ooalign{=\cr\hfil\textcolor{white}{\rule[.28ex]{.1em}{.6ex}\hspace{.2em}\rule[.28ex]{.1em}{.6ex}}\hfil\cr}}}

\begin{document}

$A\eqeqeq B$

$A\not\eqeqeq B$

$A=B$

$A\ne B$

\end{document}

If you need the symbol in \scriptstyle or \scriptscriptstyle, you can use \mathchoice:

\newcommand{\eqeqeq}{\mathrel{
   \mathchoice
     {\ooalign{=\cr\hfil\textcolor{white}{\rule[.28ex]{.1em}{.6ex}\hspace{.2em}\rule[.28ex]{.1em}{.6ex}}\hfil\cr}}
     {\ooalign{=\cr\hfil\textcolor{white}{\rule[.28ex]{.1em}{.6ex}\hspace{.2em}\rule[.28ex]{.1em}{.6ex}}\hfil\cr}}
     {\ooalign{$\scriptstyle{=}$\cr\hfil\textcolor{white}{\rule[.17ex]{.08em}{.47ex}\hspace{.18em}\rule[.17ex]{.08em}{.47ex}}\hfil\cr}}
     {\ooalign{$\scriptscriptstyle{=}$\cr\hfil\textcolor{white}{\rule[.1ex]{.06em}{.38ex}\hspace{.17em}\rule[.1ex]{.06em}{.38ex}}\hfil\cr}}
}}

enter image description here

Again, you can adjust the spacing and thickness of the gaps however you like.

5
  • Could you give an improvement to make it adjust to scriptsize?
    – M. Logic
    Aug 8, 2021 at 16:07
  • @M.Logic, I updated my response.
    – Sandy G
    Aug 8, 2021 at 18:43
  • Oops! It looks like the value of em is stuck at \normalsize. It might be possible to salvage this by explicitly specifying the desired size for each stage. (This should probably be investigated directly at the level of \mathchoice, but that's digging deeper than I feel comfortable doing.) Aug 8, 2021 at 23:27
  • @Sandy G When we use huge fontsize over such symbol, the white line will cover parts of the \not line.
    – M. Logic
    Aug 9, 2021 at 6:02
  • @M.Logic, I posted a different solution that resolves the fontsize issue.
    – Sandy G
    Aug 9, 2021 at 17:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .