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 最適化 →

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 poweredAIでLaTeXを書く

最高のAI LaTeXエディタ、Overleaf代替

Octreeは15以上の大学の研究者がAIを使って論文をより速く書くのを支援

  • AIで美しいTikZダイアグラムを生成
  • 画像をアップロードしてシームレスにLaTeXに変換
  • 論文の執筆とフォーマットに即座にサポートを取得