Skip to main content
v2026.11,986 entries · CC-BY 4.0

LaTeX Math Union: cup, bigcup and Disjoint-Union Symbols

How to write a union in LaTeX: cup for two sets, bigcup for indexed families, the disjoint-union options and fixes for common errors.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

In LaTeX, the union of two sets is written with the command \cup in math mode, for example $A \cup B$, which prints A ∪ B. The union of a whole family of sets is written with the larger operator \bigcup, usually with an index underneath: $\bigcup_{i \in I} A_i$. Disjoint union has no single standard symbol, so this guide shows which command to pick and why.

What LaTeX math union is used for in research

Union notation appears wherever a paper defines a population, a sample space, a set of records or a combined collection. A systematic searcher writes the pooled set of records found by several databases as a union. A statistician writes an event “A or B” as A ∪ B. A data-management plan that merges two repositories into one collection can state the merged set formally in the same way. In every case the symbol is only half the work: the reader also needs the surrounding definition, so the examples below pair each command with its set-builder definition.

The union symbol is a binary operator when it joins two sets and a variable-sized operator when it runs over an indexed family. The Comprehensive LaTeX Symbol List, maintained on CTAN, keeps these in separate tables: binary operators (Table 68, with \cup, \cap, \uplus, \sqcup, \vee, \wedge and \amalg) and variable-sized math operators (Table 104, with \bigcup, \bigcap, \bigsqcup and \biguplus). Knowing which table a symbol sits in tells you how it behaves in a formula. The data table below the guide lists each union-related command with the table it comes from.

How to install or access the tools that typeset a union

You do not install a package to get \cup. It is part of core LaTeX math mode, so any working LaTeX system can typeset it. You need a LaTeX system, either on your computer or in the browser.

  • In the browser: Overleaf is an online LaTeX editor. Its documentation pages on symbols and on sums and limits are written for its editor, and the examples there compile as shown.
  • On your own computer: TeX Live, supported by the TeX Users Group, provides a TeX system with binaries for Unix and GNU/Linux, macOS (as the MacTeX distribution) and Windows. MiKTeX is an implementation of TeX/LaTeX whose integrated package manager installs missing components from the Internet when a document needs them, and it ships with the TeXworks editor.

Some symbols beyond the core set need a package. The Overleaf symbol list notes that some symbols require the amssymb package. In the CTAN list, the double union \Cup (⋓) and double intersection \Cap (⋒) are in the table of AMS binary operators (Table 69), which is the amssymb set. If you use them, load the package in the preamble with \usepackage{amssymb}.

How to write a union step by step

These steps cover a two-set union, a union over an indexed family, and the in-text versus displayed forms. Each uses only commands listed in the sources below.

  1. Enter math mode. Put the formula between dollar signs for an inline formula ($ ... $) or use \( ... \). For a displayed formula on its own line, use \[ ... \]. These three delimiters are the ones used in the Overleaf documentation for sums and limits. The CTAN list states that most math symbols work only in math mode; outside it, LaTeX stops with the error “Missing $ inserted”.
  2. Write the binary union. Type A \cup B inside the math delimiters. Written as $A \cup B$, it prints A ∪ B.
  3. Define it with set-builder notation, if the paper needs a definition. A common pairing is A \cup B = \{x \mid x \in A \vee x \in B\}. Curly braces must be escaped with a backslash (\{ and \}) to print, because a bare brace only groups text for LaTeX. The command \mid gives the vertical bar, \in gives ∈, and \vee gives ∨, the logical “or” listed among the binary operators in the CTAN list.
  4. Write a union over a family. Use \bigcup with a subscript: \bigcup_{i \in I} A_i. The subscript works like the lower limit of a sum, which the Overleaf page on sums and limits writes as \sum_{lower}^{upper}. A matching definition is \bigcup_{i \in I} A_i = \{x \mid \exists\, i \in I : x \in A_i\}, which reads: the set of all x that belong to Ai for at least one index i in I. The symbol ∃ (\exists) states the “for some” condition without any extra text command.
  5. Decide inline or displayed. The CTAN list notes that variable-sized operators are taller in displayed formulas and shorter in in-text formulas. A \bigcup inside a sentence therefore looks small, while the same code between \[ and \] becomes a full-size operator. For a definition you want the reader to notice, display it.
  6. Compile and check the output (see the next section).

Worked example: a pooled set of records

Suppose a review pools the records found in three databases, D1, D2 and D3, and wants to state the pooled set R. The source code is:

\[ R = \bigcup_{i=1}^{3} D_i = D_1 \cup D_2 \cup D_3 \]

The first equality uses the indexed operator with lower and upper bounds, the same pattern as \sum_{n=1}^{\infty} in the Overleaf sums-and-limits page. The second equality spells the same set out with the binary operator. Both prints are correct; which one you choose depends on whether the number of sets is fixed and small (use \cup) or indexed and possibly large (use \bigcup). This is an illustration of notation, not a description of any real review.

How to read the output

A correct compile shows ∪ between two sets, curly braces around the set-builder expression, and a large ⋃ with the index set under it in display mode. Compare each result with the sentence it is meant to express.

  • ∪ versus ∨. The union ∪ combines sets. The logical “or” ∨ combines statements. In the set-builder definition above, ∪ appears between sets on the left and ∨ appears between the two membership statements on the right. Do not substitute one for the other: both are binary operators in the CTAN list, so LaTeX accepts either without a warning, and the error is visible only when you read the formula.
  • ∪ versus ∩. The union takes elements that are in either set; the intersection \cap keeps only elements in both. The sibling guide LaTeX set intersection covers the intersection symbols in the same way.
  • Disjoint union. The CTAN list says that, depending on context, a disjoint union may be written with ∐ (\coprod), ⊔ (\sqcup), ·∪ (\dotcup), ⊕ (\oplus), ⨿ (\amalg) or any of a number of other symbols. There is no single correct one. Choose the symbol your field or journal uses, and state in the text that the union is disjoint. The variable-sized forms \bigsqcup (⨆) and \biguplus (⨄) exist for indexed families.
  • Subset and membership. A union is often followed by a subset statement such as A ⊆ B. Those symbols are covered in LaTeX subset symbols.

Troubleshooting LaTeX math union

Symptom Likely cause Fix
“Missing $ inserted” error \cup or \bigcup typed outside math mode. The CTAN list states that most math symbols are available only in math mode. Wrap the formula in $ ... $, \( ... \) or \[ ... \].
\Cup or \Cap is undefined These double union and intersection symbols are listed with the AMS binary operators. Add \usepackage{amssymb} to the preamble.
The union operator looks tiny in a sentence Variable-sized operators shrink in in-text formulas. Move the formula to a display with \[ ... \].
Braces do not print in the set definition Bare { and } only group text. Write \{ and \}.
The disjoint union looks different from a coauthor’s There is no single symbol; several are used by convention. Agree on one command, define it once in the paper, and use it throughout.

If a formula still fails, compile a minimal document that contains only that one line. That separates a formula problem from a problem elsewhere in the file, and it is the form to share if you ask for help. Subscripts and sums follow the same rules, which is why the guide to the LaTeX sigma and summation symbols and the guide to integrals in LaTeX are useful companions for large-operator layout. For a wider tour of operators, see LaTeX math signs.

Free alternatives to a local LaTeX setup

If you only need to typeset a few formulas, you do not have to choose a single route. The table below states what each tool’s own pages say about it.

Tool What its own pages say Where it runs
Overleaf Describes itself as an online LaTeX editor; its learning pages include a list of Greek letters and math symbols and a page on integrals, sums and limits. In the browser
TeX Live A TeX system containing the major TeX-related programs, macro packages and fonts that are free software; supported by the TeX Users Group. Unix and GNU/Linux, macOS (MacTeX), Windows
MiKTeX An up-to-date implementation of TeX/LaTeX; installs missing components on demand; includes TeXworks; open source. Windows, and macOS through its installer

Frequently asked questions

What is the LaTeX code for the union symbol?

Use \cup inside math mode, for example $A \cup B$. For the large operator over an indexed family, use \bigcup.

Is the union symbol the same as “or”?

No. ∪ joins sets, while ∨ (\vee) joins statements. They are connected by the definition x ∈ A ∪ B exactly when x ∈ A or x ∈ B, but they are different symbols with different jobs.

How do I write “and” or the intersection in LaTeX?

The intersection of sets is \cap, and the logical “and” is \wedge; both are listed in the same table of binary operators as \cup and \vee. The intersection guide linked above has the worked cases.

How do I write a disjoint union?

There is no single symbol. The CTAN symbol list names ∐ (\coprod), ⊔ (\sqcup), ·∪ (\dotcup), ⊕ (\oplus) and ⨿ (\amalg) among the possibilities. Use the one your field uses and say in the text that the sets are disjoint.

Why does LaTeX say “Missing $ inserted”?

Because the union symbol was typed outside math mode. Wrap it in $ ... $, \( ... \) or \[ ... \].

How do I write a subset symbol?

See LaTeX subset symbols, which covers the subset and superset commands with their own examples.

Sources

Data: LaTeX union-related math commands, their symbols and the CTAN symbol-list table that lists them

Compiled from the Comprehensive LaTeX Symbol List on CTAN (Tables 68, 69 and 104): each union-related command, its printed symbol, its category and the table and package that list it.

LaTeX union-related math commands, their symbols and the CTAN symbol-list table that lists them
CommandSymbolCategoryCTAN tablePackage
\cup∪Binary operatorTable 68 (binary operators)Core LaTeX
\uplus⊎Binary operatorTable 68 (binary operators)Core LaTeX
\sqcup⊔Binary operatorTable 68 (binary operators)Core LaTeX
\amalg⨿Binary operatorTable 68 (binary operators)Core LaTeX
\Cup⋓Binary operator (double union)Table 69 (AMS binary operators)amssymb
\bigcup⋃Variable-sized operatorTable 104 (variable-sized math operators)Not stated in source
\bigsqcup⨆Variable-sized operatorTable 104 (variable-sized math operators)Not stated in source
\biguplus⨄Variable-sized operatorTable 104 (variable-sized math operators)Not stated in source

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about LaTeX Math Union: cup, bigcup and Disjoint-Union Symbols

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →