[Tex/LaTex] Circled not equal sign

math-operatorssymbols

How can I create a circled not equal sign similar to the image below?

Enter image description here

Best Answer

Here is a solution with a smaller \not bar, so the symbol is completely enclosed in the circle without the circle being too large.

Edit: I added another solution. The \circneqrel command provides a circled \neq symbol which is spaced as a binary relation symbol, considering the circle as the limits of the symbol (this is the first solution I posted). The \circneq command provides a similar symbol, but adjusting the spacing as if it was a simple \neq symbol.

\documentclass{article}
\usepackage{trimclip}
\newcommand{\newneq}{\clipbox{0pt 1.5pt 0pt 1.5pt}{$\neq$}}
\newlength{\bigcirclength}
\newlength{\neqlength}
\settowidth{\bigcirclength}{$\bigcirc$}
\settowidth{\neqlength}{$\neq$}
\newcommand{\circneqrel}{\mathrel{\makebox{$\bigcirc$\hspace*{-\bigcirclength}\makebox[\bigcirclength]{\newneq}}}}
\newcommand{\circneq}{\mathrel{\makebox{\makebox[\neqlength]{$\bigcirc$}\hspace*{-\neqlength}$\newneq$}}}
\begin{document}
\( E \circneqrel mc^3 \)

\( E \circneq mc^3 \)

\( E \neq mc^3 \)
\end{document}