Subject To in LaTeX (\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.
\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
- Constraint
g(x) \leq 0 - Maximize
\max_{x} - Equality Constraint
h(x) = 0 - Minimize
\min_{x} - Lagrangian
\mathcal{L}(x, \lambda) - Argmin Subscript
\arg\min_{x}
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.
Editor LaTeX AI Terbaik, Alternatif Overleaf
Octree membantu penyelidik dari 15+ universiti menulis kertas penyelidikan dengan lebih cepat menggunakan AI
- Jana diagram TikZ yang cantik menggunakan AI
- Muat naik imej dan tukar ke LaTeX dengan lancar
- Dapatkan bantuan segera untuk menulis dan memformat kertas penyelidikan