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
amssymbandamsmathin 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.
-
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} -
Select the appropriate command for your mathematical relation:
Identify the exact mathematical condition you need to express:\subsetproduces ⊂ (Standard subset relation)\subseteqproduces ⊆ (Subset or equal to)\subsetneqproduces ⊊ (Strict proper subset with slashed lower bar; requiresamssymb)\subsetneqqproduces ⫹ (Strict proper subset with slashed double bar; requiresamssymb)\varsubsetneqproduces ⊊ (Strict proper subset variant with diagonal slash; requiresamssymb)\nsubseteqproduces ⊈ (Not a subset or equal to; requiresamssymb)\not\subsetproduces ⊄ (Negated subset using core LaTeX slash overlay)\Subsetproduces ⋐ (Double subset relation; requiresamssymb)\supsetproduces ⊃ (Proper superset relation)\supseteqproduces ⊇ (Superset or equal to)\supsetneqproduces ⊋ (Strict proper superset; requiresamssymb)\sqsubsetproduces ⊏ (Square proper subset; requiresamssymb)\sqsubseteqproduces ⊑ (Square subset or equal to; core LaTeX)
-
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.
-
Compile the source file:
Compile using your TeX engine from the command line:pdflatex manuscript.texIf 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
\mathrelsymbol 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\capor\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\Subsetis 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 $ insertedand points to a subset command.
Cause: Subset commands are valid only within TeX math mode. Calling\subsetor\subseteqin 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\notappears off-center across the subset bar in certain font encodings.
Cause: The\notprimitive superimposes a generic slash over the succeeding symbol, which does not account for specific glyph bounding boxes.
Fix: Replace\not\subseteqwith the pre-composed AMS symbol\nsubseteqfromamssymb. -
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)
- The Comprehensive LaTeX Symbol List (Scott Pakin / CTAN): Official catalog of LaTeX symbols, Section 3 “Binary Relations” and “AMS Subset and Superset Relations”, available at https://ctan.org/pkg/comprehensive. Checked 2026-11-07.
- American Mathematical Society (AMS) amssymb Package Documentation (CTAN): Official AMS-LaTeX macro and font documentation, available at https://ctan.org/pkg/amssymb. Checked 2026-11-07.
- LaTeX2e Unofficial Reference Manual: Math symbols and relational math operator specifications, available at https://latexref.xyz/Math-symbols.html. Checked 2026-11-07.
- Overleaf Documentation: Mathematical Expressions and List of Greek letters and math symbols, available at https://www.overleaf.com/learn/latex/Mathematical_expressions. Checked 2026-11-07.







