The not equal sign in LaTeX


In mathematics one of the most important relations between two objects is equality. Although in day-to-day life we say that two things are equal when they are very similar, or when abstractly they are the same (they share the qualities that for us essentially identify that object), in the field of mathematics the equality relation has a much more strict and formal sense.

Not equal in LaTeX

Now that we have a small grasp of what equality means in mathematics, we can give this relation a symbol. This symbol is the universal = that you can find on your keyboard, and that was first introduced by Robert Recorde centuries ago. However, how can we denote that two things are not equal? To do so, the symbol \(\neq\) is used, and it can be printed in LaTeX with the command \neq or, more explicitly although less practical, writing \not=.

The following code shows the usage of the not equal commands in LaTeX:

% Not equal symbol in LaTeX
\documentclass{article}


\begin{document}

Not equal symbol can be obtained using the command "\verb|\neq|" as follows: 
\[
\cos x \neq \sin x
\]
or using the command "\verb|\not =|" as below:
\[
\cos x \not = \sin x
\]

\end{document}

Compiling this code yields similar results for both commands (“\neq” and “\not =”):

not equal symbol latex

We reached the end of this short tutorial, If you have any remarks or suggestions, please feel free to reach us via email at admin@latex-tutorial.comOpens in a new tab.

Recent Posts