Subject To in LaTeX (\text{s.t.})

s.t.\text{s.t.}
LaTeX command
\text{s.t.}
Package
Add to your preamble:\usepackage{amsmath}
Mode
Text and math mode

Where it is used

Abbreviation for 'subject to', introducing the constraints of an optimization problem.

In a problem statement, s.t. separates the objective from the constraints: \min_x f(x) \quad \text{s.t.} \quad g_i(x) \leq 0. Use \text so the letters are upright with the period kept, and pad it with \quad on both sides, because \text adds no spacing of its own. Many style guides prefer the full phrase \text{subject to}, especially in display formulations aligned with the align environment, where constraints stack on subsequent lines under the first one. Do not type s.t. directly in math mode; it would print italic s and t as variables with a period.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

min⁡xf(x)s.t.Ax=b,  x≥0\min_{x} f(x) \quad \text{s.t.} \quad Ax = b, \; x \geq 0
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Subject To: $\text{s.t.}$

\[ \min_{x} f(x) \quad \text{s.t.} \quad Ax = b, \; x \geq 0 \]
\end{document}

Related symbols

All Optimization →

Frequently asked questions

How do I write Subject To in LaTeX?
Type \text{s.t.} in math mode, for example $\min_{x} f(x) \quad \text{s.t.} \quad Ax = b, \; x \geq 0$. Load amsmath first with \usepackage{amsmath}.
Which package do I need for \text{s.t.}?
\text{s.t.} needs amsmath: add \usepackage{amsmath} to your preamble before the document starts.
Can I use \text{s.t.} in text mode, or only in math mode?
Both. \text{s.t.} compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.
Math poweredSumulat ng LaTeX gamit ang AI

Pinakamahusay na AI LaTeX Editor, Alternatibo sa Overleaf

Tinutulungan ng Octree ang mga researcher mula sa 15+ na unibersidad na sumulat ng research papers nang mas mabilis gamit ang AI

  • Gumawa ng magagandang TikZ diagrams gamit ang AI
  • Mag-upload ng larawan at i-convert ito sa LaTeX nang walang problema
  • Makakuha ng instant na tulong sa pagsulat at pag-format ng research papers