Math & Equations
How to Write argmin and argmax in LaTeX
The argmin and argmax operators appear constantly in optimization, machine learning, and statistics papers. By default, LaTeX doesn't provide them as built-in operators, so typing them naively produces italic text that looks wrong. The proper approach uses \DeclareMathOperator or \operatorname. Bibby AI includes argmin and argmax in its math autocomplete suggestions, so you never have to remember the boilerplate — a convenience you won't find in Overleaf.
Define argmin and argmax as Math Operators
Use \DeclareMathOperator* in the preamble (the * variant allows limits to appear directly below in display mode):
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
\begin{document}
% Limits appear below in display mode
\[
\hat{\theta} = \argmin_{\theta \in \Theta} \sum_{i=1}^{n} L(y_i, f(x_i; \theta))
\]
% Inline: limits appear as subscript
The optimal $\hat{\theta} = \argmax_{\theta} p(\mathcal{D} \mid \theta)$.
\end{document}Quick Inline Alternative with operatorname
If you only need argmin/argmax once or twice and don't want preamble commands, use \operatorname directly:
% One-off usage without preamble declaration
\[
x^* = \operatorname*{arg\,min}_{x \in \mathcal{X}} f(x)
\]
% Without the * (limits as subscripts even in display)
\[
x^* = \operatorname{arg\,min}_{x \in \mathcal{X}} f(x)
\]💡 Tips
- •Always use the * variant (\DeclareMathOperator*) so limits go below the operator in display math.
- •The \, thin space between 'arg' and 'min' is conventional — it distinguishes argmin from a variable named 'argmin'.
- •Don't write $argmin$ — it renders each letter as a separate italic variable, which is typographically wrong.
- •In Bibby AI, type 'argmin' in math mode and the autocomplete will insert the properly formatted operator for you.
Try This in Bibby AI
Write LaTeX faster with AI auto-complete and instant compilation.
Start Writing Free