Skip to content

Boolean logic in LaTeX: \land, \lor, \lnot and truth tables

LaTeX typesets logic with macros: \land, \lor and \lnot for the connectives, \oplus for exclusive or, \rightarrow and \leftrightarrow for the arrows, and an array or tabular for a truth table. The line below is the engine's LaTeX export of the entry rule, in the algebra style.

LogicLaTeX (logic style)LaTeX (algebra style)
NOT A\lnot A or \neg A\overline{A} or A'
A AND BA \land B or A \wedge BA \cdot B
A OR BA \lor B or A \vee BA + B
A XOR BA \oplus BA \oplus B
A -> BA \rightarrow B or A \to B; double arrow A \Rightarrow B or A \implies BA \rightarrow B
A <-> BA \leftrightarrow B; double arrow A \Leftrightarrow B or A \iff BA \leftrightarrow B
TRUE, FALSE\top, \bot1, 0

Two typographic traditions coexist. Logic texts write A \land B, A \lor B, \lnot A (or \neg A), A \oplus B, A \rightarrow B and A \leftrightarrow B, with \top and \bot for the constants. Digital-design texts use the algebra style: a product A \cdot B or a juxtaposition AB, a sum A + B, and an overbar \overline{A} for negation, with 1 and 0. The engine's export follows the algebra style and sets multi-letter names in \mathit{}, so member is one identifier rather than the product of six variables.

A truth table is a tabular with one column per input and one per output, \hline under the header and T/F or 1/0 in the cells; many authors add a vertical rule between inputs and outputs. The CSV and Markdown exports carry the same table, and a Markdown table pastes into most editors that support LaTeX math, so the quickest route from a rule to a typeset table is usually the Markdown export with the formula wrapped in $…$.

Spacing and grouping matter more than in code: \lnot A \land B typesets as the engine parses NOT A AND B, negating A only, and the reader has no parser to ask. Use \left( and \right) for the brackets that carry meaning, as the export does, and \overline{A \cdot B} for a negated group in the algebra style. For A XOR B XOR C the parity reading is conventional; say so in the text if the audience expects “exactly one”.

The entry rule, as the engine exports it

allow_entry := (member OR invited) AND NOT banned
allow_entry = \left(\mathit{member} + \mathit{invited}\right) \cdot \overline{\mathit{banned}}

The common slip

Writing \overline{A} \cdot B when \overline{A \cdot B} was meant, or the reverse. The overbar's extent is the grouping, and a short bar over a long product is easy to misread; the engine's export brackets the negated group explicitly.

Questions

Does the export use \land and \lor?

No. It prints the algebra style, +, \cdot and \overline{}, with names in \mathit{}. The table above gives the logic-style macros if you prefer them; the two styles are notation only, and the truth table is the same.

Which packages do I need?

None for the macros in the table except \implies, which comes from amsmath; the rest are in base LaTeX. \oplus and \leftrightarrow are standard, and \mathit{} is standard. A tabular needs no package either.

Related

See also

Languages

Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.