Union in LaTeX (\cup)
- LaTeX command
\cup- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
- Copy the Unicode character
- ∪
U+222A
Where it is used
Forms the union of sets: all elements that belong to at least one of them.
\cup is a binary operator, as in A \cup B, and gets medium spacing on both sides. For a union over an indexed family, use the large operator \bigcup, which stacks limits in display mode: \bigcup_{i=1}^{\infty} A_i. The disjoint union is often written \sqcup or \dot\cup. In probability, A \cup B corresponds to the event "A or B", giving P(A \cup B) = P(A) + P(B) - P(A \cap B). Do not use the letter U or the logical \lor in place of set union.
Also listed under: Advanced Operators, Set Theory
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Union: $\cup$
\[ P(A \cup B) = P(A) + P(B) - P(A \cap B) \]
\end{document}Related symbols
- Intersection
\cap - Subset
\subset - Empty Set
\emptyset - Not Element Of
\notin - Partial Derivative
\partial - Element Of
\in
Frequently asked questions
- How do I write Union in LaTeX?
- Type \cup in math mode, for example $P(A \cup B) = P(A) + P(B) - P(A \cap B)$. It works in plain LaTeX without loading any package.
- Which package do I need for \cup?
- None. \cup is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use \cup in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\cup$ 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 poweredWrite LaTeX using AI
Best AI LaTeX Editor, Overleaf Alternative
Octree helps researchers from 15+ universities write research papers faster using AI
- Generate beautiful TikZ diagrams using AI
- Upload image and convert it to LaTeX seamlessly
- Get instant assistance with writing and formatting research papers