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 poweredAIでLaTeXを書く

最高のAI LaTeXエディタ、Overleaf代替

Octreeは15以上の大学の研究者がAIを使って論文をより速く書くのを支援

  • AIで美しいTikZダイアグラムを生成
  • 画像をアップロードしてシームレスにLaTeXに変換
  • 論文の執筆とフォーマットに即座にサポートを取得