Skip to content
All LaTeX symbols

Such that symbol (∣, :, ∋)

Set theory

∣

LaTeX command

\mid

the bar in set-builder notation, with relation spacing

Use inside math mode: $\mid$, works in base LaTeX, KaTeX and MathJax

There is no single such-that symbol. In set-builder notation the vertical bar \mid or a colon is read as "such that". In optimisation problems people write s.t., and older texts use ∋. Pick one and use it throughout a document.

All ways to write it

  • \midthe bar in set-builder notation, with relation spacingNo package needed
  • :a colon, the other common such-that signNo package needed
  • \coloncolon with punctuation spacing, as in f\colon A \to BNo package needed
  • \ni∋, an older such-that sign, now mostly "contains as element"No package needed
  • \text{ s.t. }the written abbreviation, common in optimisationPackage: amsmath
  • \middle|a bar that grows with \left and \rightNo package needed

Commands marked with a package need that \usepackage line in a LaTeX document.

Example

\{ n \in \mathbb{Z} \mid n = 2k \text{ for some } k \in \mathbb{Z} \}

The even integers: every integer n such that n is twice another integer.

Questions

Why use \mid instead of |?

Both print a bar, but \mid is a relation and gets space on both sides, which is what set-builder notation needs. A plain | is meant for absolute value and sits tight against its neighbours.

How do I write s.t. in an equation?

Wrap it in \text so it prints upright with normal spacing: \min f(x) ;\text{s.t.}; g(x) \leq 0. \text comes from amsmath and is built into KaTeX.

Is ∋ the such-that symbol?

Some older books use it that way, but today \ni (∋) usually means "contains as an element", the mirror of \in. Most readers expect a bar or a colon.

Using such that in Confluence

Confluence Cloud has no built-in LaTeX. With LaTeX Math for Confluence you add a math macro to any page, type \mid and it renders inline or as a block, with a live preview while you edit. Every command on this page renders there without extra packages.

Related symbols

Also in Set theory

See all LaTeX symbols