95

How do I write not equal to sign (equivalent of != in C) in Latex pseudocode.

4 Answers4

140

Not equal can be written as:

\neq
Alin Huruba
  • 1,501
6

If you want a literal != in a pseudocode listing, you can use \mathrel{\mathtt{!=}}. You could also use ≠ from the monospace font.

Unicode also has the symbol ⍯ from APL. It’s U+236F, and you can use it in LuaLaTeX or XeLaTeX.

Davislor
  • 44,045
2

$\neg$ is - and $\not=$ is the equal sign with the slash through the center

M. Al Jumaily
  • 4,035
  • 2
  • 11
  • 26
Ohana
  • 21
-1

I would add that if you are using RMarkdown, to have the symbol translate to a PDF you can use either $\neq$ or $\not=$.

JamesT
  • 3,169
Lidka
  • 1