Arguments of the Minima and Maxima (\argmin
and \argmax
)
Macro Code
% Define "\argmax" and "\argmin" macros. % These definitions require the amsmath package, % which provides "\DeclareMathOperator*". \DeclareMathOperator*{\argmax}{arg\,max} \DeclareMathOperator*{\argmin}{arg\,min}
The macros \argmin
and \argmax
have the following features:
- Correct spacing depending on the surrounding context (e.g., "$\operatorname{arg\hspace{1mu}min}h(x)$" instead of "$\mathrm{arg\hspace{3mu}min}h(x)$").
- Always uses the upright mathematics font (they will not become italicized when used inside a theorem body).
- Correct placement of limits, e.g.,
\argmin_{x > 0}
is rendered as $\operatorname{arg\,min}_{x > 0}$ in inline equations, whereas in display equations it is rendered as $$\displaystyle\operatorname*{arg\hspace{1mu}min}_{x > 0}$$ - a slight space is included between "arg" and "min".
Examples
Code | Output |
---|---|
$\argmin_x f(x)$ |
$$\operatorname{arg\hspace{1mu}min}_{x} f(x)$$ |
\[ \argmax_x f(x) \] |
$$\operatorname*{arg\hspace{1mu}min}_{x} f(x)$$ |
More LaTeX macros are available at paulwintz.com/latex-macros.