Skip to main content
v2026.11,858 entries · CC-BY 4.0
LAC HealthMedical Supply Distributor100,000+ medical supplies. 48-hour critical dispatch.Ships from 8 regional U.S. hubs. Net-30 terms for verified institutional accounts.Shop lac.us CodeCASRAIlac.us

LaTeX Set Intersection: cap and bigcap Syntax

Learn how to typeset set intersections in LaTeX with cap and bigcap, including indexed families, amsmath limits, and multi-line subscript conditions.

Written and maintained by CASRAI Editorial Board

Last updated

To typeset a set intersection in LaTeX, use cap for binary intersections between two sets ($A cap B$) and bigcap for indexed collections or large families ($bigcap_{i=1}^{n} A_i$). Both commands operate within math mode, with the American Mathematical Society (AMS) package amsmath providing granular control over limit positioning, multiline indices, and equation alignment.

What it is used for in research

Mathematical set theory underpins formal methodologies across research disciplines, including discrete mathematics, computer science, probability theory, bioinformatics, and experimental design. In formal manuscripts, the set intersection operation represents the shared elements belonging to two or more collections. Researchers use set intersection notation to define:

  • Joint event probability: Expressing joint probabilities $P(A cap B)$ where events $A$ and $B$ occur simultaneously.
  • Cohort and sample overlaps: Formalizing inclusion criteria in clinical trials and epidemiological studies where participants must satisfy multiple criteria across experimental arms.
  • Genomic and bioinformatic intersections: Specifying shared differentially expressed genes across treatment groups or intersected genomic coordinate intervals.
  • Relational algebra and database query models: Expressing relational intersections and query logic in algorithmic papers.
  • Topological spaces and formal logic: Defining open set intersections, finite intersections in basis definitions, and logical conjunctions ($A cap B = { x in U mid x in A land x in B }$).

Proper typesetting ensures that mathematical manuscripts satisfy journal publication standards and maintain computational reproducibility across shared preprint and peer-reviewed releases.

Install or access (official source only)

LaTeX compiles plain text markup into publication-quality documents. To write and compile LaTeX documents containing mathematical set notations, researchers can access official software distributions or cloud-based compilers:

  • Cloud-based compilation: The Overleaf collaborative editor provides an online browser environment pre-configured with TeX Live, removing local installation requirements for research teams.
  • Local TeX distributions:
    • TeX Live: Maintained by the TeX Users Group (TUG), TeX Live is the official cross-platform distribution for Linux and Windows systems (available from tug.org/texlive).
    • MacTeX: The dedicated macOS distribution bundled by the TeX Users Group (tug.org/mactex), containing TeX Live alongside Mac-native utilities.
    • MiKTeX: An alternative open-source TeX distribution for Windows, macOS, and Linux that downloads missing packages on demand (miktex.org).

Core set intersection symbols (cap and bigcap) are built directly into standard LaTeX math mode. However, professional manuscripts should load the AMS packages in the document preamble to ensure complete typographic control:

documentclass{article}
usepackage{amsmath} % For advanced operators, substack, and limits
usepackage{amssymb} % For extended symbols like Cap and sqcap

Step-by-step task (numbered, with menu names or commands exactly as in the current docs)

Follow these steps to typeset set intersections correctly in any standard LaTeX document editor:

  1. Enter math mode: Determine whether the intersection appears inline within a sentence or displayed as an independent centered formula. Use single dollar signs $ ... $ or ( ... ) for inline math, and [ ... ] or begin{equation} ... end{equation} for display math.
  2. Typeset a binary intersection: Place the binary operator cap between two set variables.
    % Inline binary intersection
    The intersection of sets $A$ and $B$ is denoted by $A cap B$.
    
    % Displayed binary intersection
    [
    S = A cap B
    ]
  3. Typeset an indexed family of sets: Use the large operator bigcap followed by subscript limits indicating the indexing variable and bounds.
    % Displayed large intersection
    [
    bigcap_{i=1}^{n} A_i = A_1 cap A_2 cap dots cap A_n
    ]
  4. Control limit placement in inline equations: By default, LaTeX places limits next to bigcap when inside inline text to maintain even paragraph line spacing. If journal style explicitly mandates vertically stacked limits inline, apply the limits command:
    Consider the collection $bigcaplimits_{k=1}^{infty} S_k$ in the proof.

    Conversely, use nolimits inside a display equation if you want limits placed to the right side rather than vertically stacked.

  5. Format multiline subscript conditions: When an indexed intersection requires multiple constraints (such as index conditions excluding zero), use the substack command provided by amsmath:
    [
    bigcap_{substack{i in I \ i ne j}} A_i
    ]

    For larger derivations requiring alignment across equality signs, integrate with multi-line equation alignments in LaTeX.

  6. Typeset set-builder notation with proper relational spacing: When defining an intersection set-theoretically, use mid rather than a keyboard vertical pipe | to ensure correct horizontal spacing around the conditioning bar:
    [
    A cap B = { x in U mid x in A land x in B }
    ]

Output and how to read it

LaTeX distinguishes between binary operators and large operators through internal math classes, which govern horizontal spacing and font sizing:

  • Binary operator class (mathbin): The cap symbol is classified as a binary operator. LaTeX automatically inserts standard medium horizontal spacing (medmuskip) on both sides of the symbol when flanked by set identifiers ($A cap B$), identical to addition ($A + B$).
  • Large operator class (mathop): The bigcap symbol belongs to the large operator class. In display mode, the engine scales the glyph to a larger size and positions subscript and superscript limits directly beneath and above the symbol. In inline text mode, the engine scales the glyph down to match the text x-height and places limits as side subscripts.

The table below summarizes standard LaTeX set operations, their mathematical classifications, and required packages based on CTAN and AMS documentation:

Operation Rendered Notation LaTeX Command Math Class Required Package
Binary Intersection A ∩ B cap mathbin Core LaTeX
Indexed Family Intersection ⋂_{i=1}^n A_i bigcap mathop Core LaTeX
Square Intersection A ⊓ B sqcap mathbin Core LaTeX
Large Square Intersection ⨅_{i=1}^n A_i sqbigcap mathop amssymb
Double Cap Intersection A ⋒ B Cap mathbin amssymb
Set Union (Dual) A ∪ B cup mathbin Core LaTeX
Large Set Union ⋃_{i=1}^n A_i bigcup mathop Core LaTeX
Subset Inclusion A ⊆ B subseteq mathrel Core LaTeX
Set-Builder Condition Bar { x ∈ U | … } mid mathrel Core LaTeX

When compiling multidimensional mathematical models involving indexed set intersections and matrix representations, consult LaTeX matrix formatting for structured mathematical arrays.

Troubleshooting

Researchers encountering syntax or layout errors with set intersections should check the following common issues:

  • Error: Missing $ inserted:

    Cause: Attempting to use cap, bigcap, or subscript syntax (_) in standard text mode.

    Fix: Wrap the mathematical expression in math delimiters (e.g., $A cap B$ instead of raw text A cap B).

  • Error: Undefined control sequence Cap or substack:

    Cause: The document omitted usepackage{amssymb} or usepackage{amsmath} from the preamble.

    Fix: Add usepackage{amsmath,amssymb} in the preamble before begin{document}.

  • Uneven paragraph line spacing from inline limits:

    Cause: Forcing limits above and below an inline $bigcaplimits_{i=1}^n$ forces the TeX line breaker to push preceding and succeeding text lines apart, creating distracting gaps in paragraphs.

    Fix: Remove limits in inline prose, allowing subscripts to sit beside the symbol ($bigcap_{i=1}^n$), or promote the expression to an unnumbered display equation [ ... ].

  • Cramped spacing in set-builder definitions:

    Cause: Using a literal ASCII vertical bar { x | x in A }, which TeX treats as an ordinary symbol (mathord) with zero padding.

    Fix: Replace | with mid, which TeX formats as a relational operator (mathrel), inserting standard medium spaces around the separator.

  • Script reproducibility and version tracking:

    When publishing reproducible analysis code and computational pipelines alongside manuscripts, adhere to open code standards to archive the LaTeX sources and associated analysis scripts.

Free alternatives (table)

Researchers writing mathematical manuscripts have multiple free and open-source environments for drafting and rendering LaTeX set notations:

Tool / Environment Platform / Distribution Primary Research Use Case Set Intersection Support License Model
Overleaf Community Edition Web browser / Self-hosted Collaborative authoring and shared manuscript drafting Full native LaTeX (cap, bigcap, amsmath) Open Source (AGPL-3.0)
TeX Live / MacTeX Linux, Windows, macOS Complete local document compilation and offline publishing Full native LaTeX and TeX engines Free Software (GNU GPL / LPPL)
VS Code + LaTeX Workshop Cross-platform desktop IDE Integrated coding, manuscript authoring, and PDF preview Full native LaTeX via local TeX distribution Open Source (MIT License)
Quarto / R Markdown Cross-platform CLI & RStudio Reproducible scientific reports combining code, data, and math MathJax and KaTeX support for cap and bigcap Open Source (GNU GPL-2.0)

FAQ

What is the difference between cap and bigcap in LaTeX?

cap is a binary operator designed for operations between two sets (such as $A cap B$), producing standard binary spacing. bigcap is a large variable-sized operator designed for indexed collections (such as $bigcap_{i=1}^n A_i$). In display equations, bigcap scales up and positions its index limits directly above and below the symbol, similar to a summation operator.

How do you write a set intersection symbol in inline LaTeX without breaking line height?

Use standard inline math mode with $bigcap_{i=1}^n A_i$ without adding the limits modifier. Standard LaTeX automatically positions the limits to the side of the symbol as subscripts and superscripts in text mode, preserving uniform paragraph line leading.

How do you write set union and set intersection together in LaTeX?

Use cap for intersection and cup for union. For example, the distributive law is typeset as $A cap (B cup C) = (A cap B) cup (A cap C)$. For indexed families, pair bigcap with bigcup.

How do you format set-builder notation for intersections in LaTeX?

Set-builder notation is formatted inside math mode by escaping curly braces with backslashes and using mid for the condition bar: { x in U mid x in A land x in B }. The mid command provides appropriate relational operator spacing on both sides of the vertical divider.

What package is needed for bigcap with multi-line conditions?

Multi-line subscript conditions under bigcap require the amsmath package. Load usepackage{amsmath} in your document preamble and use the substack command: bigcap_{substack{i in I \ i ne 0}} A_i.

Sources (official docs)

Follow CASRAI

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

Ask CASRAI · free to try

Ask about LaTeX Set Intersection: cap and bigcap Syntax

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

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 free 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 →