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: الجبر البولياني, علوم الحاسوب

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 المنطق والبراهين →

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 poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث