21

I can’t find the LaTeX command for the symbol below. Can anyone help me out to find this symbol? I wasn't able to find it with Detexify.

enter image description here

lockstep
  • 250,273
ravi
  • 1,379

6 Answers6

23

Depending on your usage, the following may suffice:

enter image description here

\documentclass{article}
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\newcommand{\crosseq}{\mathrel{\ooalign{$\neq$\cr\reflectbox{$\neq$}\cr}}}
\begin{document}
$f(x) = g(x) \neq h(x) \crosseq i(x)$
\end{document}

The symbol \crosseq consists of an overlay of \neq and a reflected \neq. For a short lesson in \ooalign and symbol overlaying, see \subseteq + \circ as a single symbol (“open subset”).

Werner
  • 603,163
  • hi its not working here Werner. it displays 2 \neq nearer only,,, – ravi Aug 07 '13 at 07:49
  • 1
    @ravi: Do you receive errors? Did you include the graphicx package? Did you copy it correctly? What "[is] not working"? – Werner Aug 07 '13 at 07:52
  • i copied the above entire code and paste it in tex file and run it. im not getting the exact output what displayed here – ravi Aug 07 '13 at 08:03
  • @ravi: I'm using one of the basic packages/tools (graphicx) and compiling under pdflatex. Note that \crosseq can only be used in math mode. Are you getting an error or a warning? – Werner Aug 07 '13 at 08:11
23

Well here is one that looks kinda like cheating, it uses amsmath only, though adding calc will make the definition much simpler:

\documentclass{article}
\usepackage{amsmath}

\newlength{\crossl}
\settowidth{\crossl}{$\times$}
\newlength{\ceql}
\settowidth{\ceql}{$\times=$}
\addtolength{\ceql}{-\crossl}
\newcommand{\crosseq}{\mathrel{\makebox[\crossl][l]{$\times\hspace{-\ceql}=$}}}

\begin{document}
$f(x)\crosseq g(x)\crosseq h(x)$
\end{document}

Result:

enter image description here

One can also play around with the position and the symbols used:

\newcommand{\crosseq}{\mathrel{\makebox[7.7778pt][l]{$\neq$\hspace{-6.7778pt}\raisebox{-2.5pt}{$\backslash$}}}}

enter image description here

EDIT: Since this answer is chose I will add some more solution, this time using egreg's suggestion as poking around with boxes will likely create unexpected spacing issue:

\newcommand{\crosseq}{\mathrel{\ooalign{\hidewidth$/$\hidewidth\cr\ooalign{\hidewidth$\backslash$\hidewidth\cr$=$\cr}\cr}}}

or

\newcommand{\crosseq}{\mathrel{\ooalign{\hidewidth$/$\hidewidth\cr\ooalign{\hidewidth\raisebox{-2pt}{$\backslash$}\hidewidth\cr$=$\cr}\cr}}}

Result:

enter image description here

EDIT2: Add [l] option to \makebox in order to adjust alignment.

Francis
  • 6,183
15

Just for a change, no \ooalign:

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx,calc}

% make \widthof usable with \hspace
% http://tex.stackexchange.com/a/99242
\makeatletter
\def\@hspace#1{\begingroup\setlength\dimen@{#1}\hskip\dimen@\endgroup}
\makeatother

\newcommand{\rnot}{%
  \mathrel{%
    \text{%
      \makebox[0pt][l]{%
        \hspace{\widthof{$=$}}\reflectbox{$\not$}%
      }%
    }%
  }%
}
\newcommand{\crosseq}{\rnot\not=}

\begin{document}
$a\crosseq b$
\end{document}

enter image description here

egreg
  • 1,121,712
  • This looks nicer than the first answer, and especially than the one based on xcancel as the cross is vertically centred on the = sign – Chris H Aug 07 '13 at 09:24
15

You might consider using the cancel package. Its command \xcancel places a cross over any given symbol. For a relation symbol like = you should enclose the whole construct in \mathrel to get the correct horizontal spacing:

Sample output

\documentclass{article}

\usepackage{cancel}

\newcommand{\cancelledeq}{\mathrel{\xcancel{=}}}

\begin{document}

\( a = b \cancelledeq c \)

\end{document}
Andrew Swann
  • 95,762
5

Poor man's code (simplified and stolen from egreg's):

\documentclass{article}
\usepackage{mathtools}
\usepackage{graphicx}
%
\newcommand{\crosseq}{%
  \mathrel{%
    \text{%
        {$\neq$\reflectbox{$\not$}}%
    }%
  }%
}

\begin{document}
$a\crosseq b$
\end{document}

enter image description here

4

on the theory that there was some meaning to the asymmetry of the original drawing, and stealing egreg's very nice name for the symbol, here's another approach.

\documentclass{article}
\usepackage{mathtools}
\usepackage{amssymb}

\newcommand{\crosseq}{\mathrlap{{}\mathrel{\smallsetminus}{}}\not=}

\begin{document}
$a\crosseq b$
\end{document}

output of example code