Negation in LaTeX (\neg)

¬\neg
LaTeX command
\neg
Package
No package needed: built into LaTeX
Mode
Math mode only
Copy the Unicode character
¬U+00AC

Where it is used

Logical negation sign, an L-shaped hook placed before a formula to mean not.

Logic writes \neg p for not p and \neg\neg p \equiv p in classical logic; \lnot is an exact alias. Some texts use \sim p, an overline \bar{p}, or p' instead, especially in Boolean algebra and digital circuits. \neg is an ordinary symbol, so no space appears between it and its operand, which is the desired look. De Morgan's laws, \neg(p \land q) \equiv \neg p \lor \neg q, are a typical display. In programming contexts ! or \lnot are both seen.

Also listed under: Boolean Algebra, Computer Science

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

¬(p∧q)≡¬p∨¬q\neg (p \land q) \equiv \neg p \lor \neg q
\documentclass{article}
\begin{document}
Negation: $\neg$

\[ \neg (p \land q) \equiv \neg p \lor \neg q \]
\end{document}

Related symbols

All Logic & Proofs →

Frequently asked questions

How do I write Negation in LaTeX?
Type \neg in math mode, for example $\neg (p \land q) \equiv \neg p \lor \neg q$. It works in plain LaTeX without loading any package.
Which package do I need for \neg?
None. \neg is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \neg in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\neg$ in running text. If you only need the glyph in text, paste the Unicode character ¬ instead (with XeLaTeX or LuaLaTeX and a font that has it).
Math poweredWrite LaTeX using AI

Best AI LaTeX Editor, Overleaf Alternative

Octree helps researchers from 15+ universities write research papers faster using AI

  • Generate beautiful TikZ diagrams using AI
  • Upload image and convert it to LaTeX seamlessly
  • Get instant assistance with writing and formatting research papers