CTAN Comprehensive TeX Archive Network

Directory macros/latex/contrib/setbuilder

README.md

setbuilder

Version 0.2.0 (2026-07-28)

Smart set-builder notation for : one command instead of \left\{ ... \,\middle\vert\, ... \right\}.

\usepackage{setbuilder}
...
\set{x \in \mathbb{R} \given x^2 < 2}      % { x ∈ ℝ | x² < 2 }
\set*{\frac{n}{n+1} \given n \in \mathbb{N}}   % braces AND bar auto-scale
\set[\Big]{x \given f(x) = \max_y f(y)}    % fixed size

Features:

  • correct thin spaces around the separator, which automatically vanish in sub/superscripts (\nonscript);
  • a thin space just inside the braces — but only for a set given by a condition, { x | x > 0 }, never for a plain enumeration, {1, 2, 3} (Knuth, book);
  • the separator bar scales together with the braces in the starred and sized forms;
  • line breaks are permitted after the bar in inline formulas;
  • \suchthat as a synonym of \given; both give a descriptive error when used outside \set.

Options

Option Effect
bar (default) separator is a vertical bar: { x \ x > 0 }
colon separator is a colon: { x : x > 0 }
pad=<mu glue> space inside the braces, default \,; pad=none disables it
synonym=<name> additionally define \<name> as a full copy of \set

If another package already defines \set, setbuilder leaves it untouched and recommends choosing a synonym:

\usepackage[synonym=mkset]{setbuilder}

Installation

Once on CTAN, the package is available in Live and MiK: tlmgr install setbuilder. For manual installation, copy setbuilder.sty into your project directory or into your personal tree (~/texmf/tex/latex/setbuilder/).

Requirements

  • mathtools
  • kernel 2022-06-01 or newer (key-value options, \NewCommandCopy)

Documentation

See setbuilder.pdf for the full manual with typeset examples.

Author

Vseslav Sekorin <vssekorin@gmail.com>

License

Copyright (c) 2026 Vseslav Sekorin. This material is subject to the MIT License; see the LICENSE file for the full text.

Download the contents of this package in one zip archive (212.9k).

setbuilder – Mathematical sets with correctly scaled braces and separator

The package provides a \set command for set-builder notation: \set{x \in \mathbb{R} \given x^2 < 2}. The separator (a vertical bar, or a colon with the colon option) is typeset with correct thin spaces, which automatically vanish in sub- and superscripts. The starred form \set* scales the braces and the separator together; \set[\Big] sets a fixed size. A synonym=<name> package option defines the same command under a different name, e.g. when \set is already taken by another package. The package is based on mathtools.

Packagesetbuilder
Bug tracker
Repository
Version0.2.0
LicensesMIT License
Copyright2026 Vseslav Sekorin
MaintainerVseslav Sekorin
Contained inTeX Live as setbuilder
MiKTeX as setbuilder
TopicsMaths
...
Guest Book Sitemap Contact Contact Author