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 Lohika at 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 poweredSumulat ng LaTeX gamit ang AI

Pinakamahusay na AI LaTeX Editor, Alternatibo sa Overleaf

Tinutulungan ng Octree ang mga researcher mula sa 15+ na unibersidad na sumulat ng research papers nang mas mabilis gamit ang AI

  • Gumawa ng magagandang TikZ diagrams gamit ang AI
  • Mag-upload ng larawan at i-convert ito sa LaTeX nang walang problema
  • Makakuha ng instant na tulong sa pagsulat at pag-format ng research papers