LatexNotes

Not / negation (¬) in LaTeX

\neg prints ¬, the logical not (negation) sign, so \neg P reads 'not ; \lnot is another name for the same symbol.

LaTeX command

\neg

Not the symbol you meant? Draw it to find the command →

Typing up handwritten notes? Convert a whole page of handwriting to LaTeX →

\neg and \lnot give the same output, just as \land and \wedge do. LaTeX treats ¬ as an ordinary symbol, so it sits right against what it negates: , . Brackets make it clear how much is negated.

To negate a relation, LaTeX has ready-made symbols: \neq (≠), \notin (∉), and, from amssymb, \nmid (∤) and \nsubseteq (⊈). For any other relation, \not puts a slash through the next symbol, as in .

Some fields write negation differently. Digital logic and Boolean algebra put a bar over the expression, , and some older logic books use a tilde, . Use the notation of your course or field, and keep it the same throughout.

Other forms

\lnotthe same symbol as \neg
\notinnot an element of (∉)
\not\equiva slash through any relation (≢)
\overline{A}bar notation, Boolean algebra

Examples

$\neg P$

not P

$\neg (P \land Q) \iff \neg P \lor \neg Q$

De Morgan's law

$\neg \forall x \, P(x) \iff \exists x \, \neg P(x)$

negating a statement about every x

$x \notin A$

x is not an element of A

$a \not\equiv b \pmod{n}$

a slash through any relation with \not

$\overline{A \cdot B} = \overline{A} + \overline{B}$

bar notation in Boolean algebra

Tips and common mistakes

Working from handwritten notes?

LatexNotes turns a photo or PDF of handwritten mathematics into LaTeX, graphs and all. It is built with real pdflatex before you see it, and the .tex file is yours to edit or take to Overleaf. Free to try, no sign-up.

See how handwriting to LaTeX works, step by step, or go from GoodNotes to LaTeX if you write on an iPad (Notability works the same way).

Convert your maths to LaTeX →

FAQ

How do I write the not symbol in LaTeX?

Use \neg or \lnot in maths mode; both print ¬, for example \neg P.

How do I write 'not an element of' in LaTeX?

Use \notin, which prints ∉.

How do I put a slash through a symbol?

Put \not before the relation, for example \not\equiv gives ≢. Common cases have their own commands, such as \neq and \notin.

How do I write a bar over an expression for negation?

Use \overline{...}, for example \overline{A + B}, the usual notation in Boolean algebra.

See also