Optimization notation in LaTeX centres on \min, \max and their arg versions. \min_{x} and \max_{x} are built in and put the variable under the operator in display math, but there is no built-in \argmax: write \operatorname*{arg\,max}_x or declare \argmax once with \DeclareMathOperator* from amsmath. Constraints follow \text{s.t.}, the Lagrangian is \mathcal{L}(x, \lambda), the optimum is x^*, and semidefinite constraints use \succeq 0. The table lists the optimization symbols people use most, with the package each one needs; the full list follows below.
| Symbol | Command | Use | Package | Copy |
|---|---|---|---|---|
\operatorname*{arg\,max}_{x} f(x) | Argmax with the variable underneath | amsmath | ||
\operatorname*{arg\,min}_{x} f(x) | Argmin with the variable underneath | amsmath | ||
\min_{x \in \mathcal{X}} f(x) | Minimise over a set | built in | ||
\max_{x} f(x) | Maximise | built in | ||
\text{s.t.} | Subject to | amsmath | ||
g_i(x) \leq 0 | Inequality constraint | built in | ||
h_j(x) = 0 | Equality constraint | built in | ||
\mathcal{L}(x, \lambda) | Lagrangian | built in | ||
\nabla f(x^*) = 0 | First-order optimality condition | built in | ||
\nabla^2 f(x) | Hessian | built in | ||
X \succeq 0 | Positive semidefinite | built in | ||
\lambda_i \geq 0 | Dual variables (multipliers) | built in |
A full problem lines up neatly in an aligned environment from amsmath; the optidef package offers ready-made mini and maxi environments if you write many of them:
\[
\begin{aligned}
\min_{x \in \mathbb{R}^n} \quad & f(x) \\
\text{s.t.} \quad & g_i(x) \leq 0, \quad i = 1, \dots, m \\
& h_j(x) = 0, \quad j = 1, \dots, p
\end{aligned}
\]\arg\max\arg\min\arg\max_{x}\arg\min_{x}\min_{x}\max_{x}\text{s.t.}g(x) \leq 0h(x) = 0\mathcal{L}(x, \lambda)\lambda\nabla f(x)\nabla^2 f(x)\mathcal{X}\nabla f + \lambda \nabla g = 0\mathcal{C}\succ 0\succeq 0