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.
최고의 AI LaTeX 편집기, Overleaf 대안
Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움
- AI로 아름다운 TikZ 다이어그램 생성
- 이미지를 업로드하고 LaTeX로 원활하게 변환
- 논문 작성 및 서식에 대한 즉각적인 지원 받기