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

LaTeX Subset: Commands, Syntax and AMS Symbols

Learn how to write subset in LaTeX using subset, subseteq, and AMS subsetneq commands, resolve notation ambiguity, and format set relations in papers.

Written and maintained by CASRAI Editorial Board

Last updated

Typesetting mathematical relations accurately is fundamental to publishing clear research in mathematics, computer science, statistics, and engineering. In LaTeX, set inclusion is expressed using subset relation commands such as \subset, \subseteq, and AMS extensions like \subsetneq. This guide provides the complete syntax, package requirements, spacing mechanics, and compilation steps necessary to typeset subset relations in research manuscripts without notation ambiguity or compile errors.

What it is used for in research

In academic literature, set relations describe containment, state spaces, sample spaces, domain restrictions, and algebraic sub-structures. When writing papers that feature set theory or formal logic, authors must convey exact mathematical containment. The two most common search and formatting tasks are writing a subset in latex and choosing between strict and non-strict subset latex notations.

A critical challenge in mathematical writing is notation ambiguity across international standards and disciplinary traditions:

  • ISO 80000-2 and DIN 5473 Standards: Under international standard ISO 80000-2 (quantities and units, mathematical signs and symbols), non-strict inclusion (where set A is contained in or equal to set B) is represented exclusively by ⊆ (\subseteq). Strict inclusion (where set A is contained in set B but not equal to set B) is represented exclusively by ⊊ (\subsetneq). The bare symbol ⊂ (\subset) is deprecated in these standards because its interpretation varies between authors.
  • Anglo-American Mathematical Convention: Many English-language textbooks and journals historically used \subset (⊂) to denote proper (strict) subsets and \subseteq (⊆) for general inclusion.
  • European and Set-Theoretic Convention: Conversely, many European publications historically employed \subset (⊂) to denote general subset relations, using \subsetneq (⊊) when strict containment needed explicit distinction.

To eliminate ambiguity in peer-reviewed research, journal editors and style manuals recommend using \subseteq for general subsets and \subsetneq for strict subsets. When combined with set operations like set intersections, these commands provide clear and verifiable mathematical proofs.

Install or access (official source only)

LaTeX subset commands belong to two distinct categories: standard core kernel commands and extended American Mathematical Society (AMS) symbols.

1. Standard LaTeX Core Commands

Basic subset commands—including \subset, \subseteq, \supset, and \supseteq—are primitive math symbols included in the base LaTeX kernel. They require no package imports and are supported by every standard TeX engine (pdfLaTeX, LuaLaTeX, XeLaTeX).

2. Extended AMS-LaTeX Commands

Strict subset symbols (\subsetneq, \subsetneqq, \varsubsetneq), negated relations (\nsubseteq, \nsupseteq), and double inclusion (\Subset) are defined in the amssymb package (maintained by the American Mathematical Society on CTAN). The amssymb package automatically imports amsfonts, providing access to the MSAM and MSBM mathematical symbol font tables.

Accessing TeX Environments

Researchers can access these tools through official, established distributions:

  • TeX Live: Maintained by the TeX Users Group (TUG) via CTAN. Includes amssymb and amsmath in default installation profiles across Linux, Windows, and macOS.
  • MiKTeX: An open-source distribution for Windows, macOS, and Linux that includes automatic, on-the-fly package installation for CTAN libraries.
  • Overleaf: A cloud-based collaborative editing platform that runs TeX Live server-side. For institutional or self-hosted deployment details, see our review of collaborative LaTeX editors.

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

Follow these numbered steps to configure, write, and compile subset relations in your LaTeX document.

  1. Import required packages in the document preamble:
    Open your document’s preamble (between \documentclass{...} and \begin{document}) and declare the AMS mathematical symbol packages:

    \documentclass[11pt,a4paper]{article}
    \usepackage{amsmath}
    \usepackage{amssymb}
  2. Select the appropriate command for your mathematical relation:
    Identify the exact mathematical condition you need to express:

    • \subset produces ⊂ (Standard subset relation)
    • \subseteq produces ⊆ (Subset or equal to)
    • \subsetneq produces ⊊ (Strict proper subset with slashed lower bar; requires amssymb)
    • \subsetneqq produces ⫹ (Strict proper subset with slashed double bar; requires amssymb)
    • \varsubsetneq produces ⊊ (Strict proper subset variant with diagonal slash; requires amssymb)
    • \nsubseteq produces ⊈ (Not a subset or equal to; requires amssymb)
    • \not\subset produces ⊄ (Negated subset using core LaTeX slash overlay)
    • \Subset produces ⋐ (Double subset relation; requires amssymb)
    • \supset produces ⊃ (Proper superset relation)
    • \supseteq produces ⊇ (Superset or equal to)
    • \supsetneq produces ⊋ (Strict proper superset; requires amssymb)
    • \sqsubset produces ⊏ (Square proper subset; requires amssymb)
    • \sqsubseteq produces ⊑ (Square subset or equal to; core LaTeX)
  3. Write the expression within LaTeX math mode:
    Subset commands cannot be invoked in plain text mode. Place them inside inline math delimiters ($...$) or display math delimiters (\[...\]):

    % Inline mathematical expression
    Let $S \subseteq \mathbb{R}^n$ be a compact subset.
    
    % Display mathematical expression
    \[
    A \subsetneq B \subseteq C
    \]

    When embedding these statements in formal theorems, equations can be cross-referenced using LaTeX ref syntax.

  4. Compile the source file:
    Compile using your TeX engine from the command line:

    pdflatex manuscript.tex

    If using an IDE such as TeXworks, TeXstudio, or Overleaf, click Recompile (or press Ctrl+Enter / Cmd+Enter).

Output and how to read it

In LaTeX math typesetting, subset operators are internally assigned the math class \mathrel (relational operator). LaTeX formatting engines apply distinct horizontal spacing rules based on math atom classifications:

  • Relational spacing: A \mathrel symbol automatically receives thick horizontal math space (\thickmuskip, defined by default as 5/18 em) on both sides when adjacent to ordinary math atoms (\mathord, such as variables $A$ and $B$).
  • Comparison with binary operators: Unlike binary operations (\mathbin, such as \cap or \cup) which receive medium space (\medmuskip, 4/18 em) and collapse in script styles, relational spacing remains distinct to clearly demarcate the proposition.

When rendered in your compiled PDF document:

  • $A \subseteq B$ renders as $A$ followed by standard thick space, the subset-or-equal symbol ⊆, another thick space, and $B$.
  • $A \subsetneq B$ visually demonstrates that $A$ is strictly contained in $B$ while explicitly barring set equality ($A \neq B$). In formal lemma and theorem environments, this notation frequently precedes proof endings and QED symbols.

Troubleshooting

When compiling documents containing subset commands, you may encounter the following common TeX engine errors:

  • Undefined control sequence: \subsetneq
    Symptom: The compiler halts with ! Undefined control sequence. l.15 A \subsetneq B.
    Cause: The command \subsetneq, \nsubseteq, or \Subset is being called without loading the AMS symbol library.
    Fix: Add \usepackage{amssymb} to your document preamble before \begin{document}.
  • Missing $ inserted
    Symptom: The compiler reports ! Missing $ inserted and points to a subset command.
    Cause: Subset commands are valid only within TeX math mode. Calling \subset or \subseteq in regular paragraph text triggers this error.
    Fix: Wrap the expression in math mode delimiters, such as $A \subseteq B$ for inline text or \[ A \subseteq B \] for standalone equations.
  • Unaligned or uneven negation slash with \not\subseteq
    Symptom: The negation slash drawn by \not appears off-center across the subset bar in certain font encodings.
    Cause: The \not primitive superimposes a generic slash over the succeeding symbol, which does not account for specific glyph bounding boxes.
    Fix: Replace \not\subseteq with the pre-composed AMS symbol \nsubseteq from amssymb.
  • Excessive or double spacing around relations
    Symptom: Gaps around the subset symbol appear disproportionately wide.
    Cause: Authors sometimes manually insert text spaces or non-breaking spaces inside math mode.
    Fix: Remove manual spacing. LaTeX’s math font metric engine calculates optimal relational spacing automatically.

Free alternatives (table)

The following table lists verified, free, and open-source TeX distributions and software platforms for authoring documents with mathematical and subset notation:

Platform / Tool Distribution Type License Supported OS Package Management & AMS Support
TeX Live Full TeX distribution LPPL / GPL / Free Software Linux, Windows, macOS Includes tlmgr; standard collections package amssymb and amsmath by default.
MiKTeX Modular TeX distribution Open Source (various) Windows, macOS, Linux Integrated package manager installs missing CTAN packages on demand during compilation.
MacTeX macOS TeX distribution bundle LPPL / GPL macOS Native macOS packaging of TeX Live, including TeXShop and full AMS mathematical font collections.
Overleaf Community Edition Web-based collaborative editor AGPL v3 Linux (Docker self-hosted) Self-hosted browser interface built on TeX Live with real-time compilation and multi-user editing.

FAQ

What is the difference between \subset and \subseteq in LaTeX?

In LaTeX, \subset generates the symbol ⊂ while \subseteq generates the symbol ⊆ with a bottom horizontal bar. Under international mathematical standard ISO 80000-2, \subseteq is the designated notation for non-strict subset relations (indicating that set A is contained within or equal to set B). Because historical literature inconsistently treated \subset as either strict or non-strict inclusion, modern scientific writing utilizes \subseteq for general subsets and \subsetneq for strict subsets to prevent ambiguity.

Which package is required for \subsetneq and \nsubseteq in LaTeX?

The amssymb package is required. Include \usepackage{amssymb} in your document preamble. This package loads the American Mathematical Society (AMS) font tables (MSAM and MSBM), enabling specialized set relations including \subsetneq, \subsetneqq, \varsubsetneq, \nsubseteq, \Subset, and \sqsubset. Core commands like \subset and \subseteq are built into the standard LaTeX kernel and do not require any package import.

How do you write “not a subset” in LaTeX?

The recommended command is \nsubseteq, which produces ⊈ and requires the amssymb package. If working in a bare LaTeX environment without additional packages, you can use the kernel command \not\subset (to produce ⊄) or \not\subseteq (to produce ⊈), which applies a slash overlay across the respective base symbol.

Can LaTeX subset commands be used in regular paragraph text?

No. Subset commands are mathematical relation symbols classified under \mathrel and can only be evaluated inside LaTeX math mode. Invoking \subset or \subseteq in text mode produces a ! Missing $ inserted compilation error. You must wrap the symbol or statement in inline delimiters ($A \subseteq B$) or display delimiters (\[ A \subseteq B \]).

Sources (official docs)

Follow CASRAI

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

Ask CASRAI · free to try

Ask about LaTeX Subset: Commands, Syntax and AMS Symbols

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 →