The boolean algebra symbols in LaTeX reuse the logic connectives: the AND symbol is \land (∧), the OR symbol is \lor (∨) and NOT is \lnot (¬). XOR in LaTeX is \oplus (⊕), or \veebar from amssymb. Implication and equivalence are \Rightarrow and \iff, the constants true and false are \top and \bot, and the quantifiers are \forall and \exists. All of them go in math mode. The table lists the commands people use most, with the package each one needs; the full list of logic gate symbols follows below.
| Symbol | Command | Use | Package | Copy |
|---|---|---|---|---|
\land | AND (alias \wedge) | built in | ||
\lor | OR (alias \vee) | built in | ||
\lnot | NOT (alias \neg) | built in | ||
\overline{A} | NOT, bar notation | built in | ||
\oplus | XOR (exclusive or) | built in | ||
\veebar | XOR, logic style | amssymb | ||
\barwedge | NAND | amssymb | ||
\Rightarrow | Implies | built in | ||
\iff | If and only if (equivalence) | built in | ||
\top | True, 1 | built in | ||
\bot | False, 0 | built in | ||
\forall x \, \exists y | For all, there exists | built in |
Digital-design and circuit texts prefer the algebraic style: A \cdot B or just AB for AND, A + B for OR, and a bar for negation, written \overline{A} for a whole expression or \bar{A} for a single letter. De Morgan’s law then reads \overline{A \cdot B} = \overline{A} + \overline{B}. The Sheffer stroke and Peirce arrow can be written as \uparrow and \downarrow, and the Boolean domain is \mathbb{B} = \{0, 1\}.
Add \usepackage{amsmath, amssymb} to the preamble for \veebar, \barwedge, \implies and \mathbb. For truth tables, the tabular environment with $\land$ in the header row is enough. See our guide to mathematical expressions in LaTeX for spacing and alignment, and the logic symbols page for quantifiers and turnstiles.
\land\lor\neg\oplus\barwedge\bar{\vee}\odot\Rightarrow\Leftrightarrow\top\botA \cdot BA + B\overline{A}\overline{A \cdot B} = \overline{A} + \overline{B}