I want to achieve this


but if I use


it does not put y\in\mathcal{Y} below argmax. How can I solve this?


2 Answers 2


Welcome to TeX.SX! What you probably struggle with is the fact that TeX knows two different modes of typesetting math: inline and display. While display math is used to display mathematical formulas separate from floating text, inline math is used, well, in-line, that is, in the context of other surrounding text.

As for your concrete example, the argument {y \in \mathscr{Y}} will not be placed underneath "argmax" when you use inline math. This is a typographic decision made by TeX to reduce the space mathematical formulas take when typeset inline. If you use your command in an display-math environment, it will be typeset as you intend:

enter image description here

The above output is generated by the following code:




This is inline: $\argmax_{y \in \mathcal{Y}}$ and more text to follow.


This is not:

\[ \argmax_{y \in \mathcal{Y}} \]


As long as you use the macro \DeclareMathOperator* (provided by the amsmath package) to declare the operator via, say,


TeX will place the argument of the operator -- here: y\in\mathcal{Y} -- below the operator itself (a) if the instruction is encountered in display-style math mode (unless overridden by a \nolimits instruction) or (b) if the operator instruction is followed by \limits while in text style (or script or scriptscript style).

This is summarized in the following table. The first column shows the default behavior for the four math styles, i.e., without the use of \nolimits or \limits. The second column shows the result of overriding the default, either via \nolimits for display-style math or via \limits for the other three math styles.

enter image description here

\usepackage{amsmath} % for '\DeclareMathOperator*' macro

\usepackage{array} % for '\newcolumntype' macro


\renewcommand\arraystretch{1.5} % just for this example
\begin{tabular}{ LL >{\ttfamily}l }
  \displaystyle \argmax_{y\in\mathcal{Y}} 
& \displaystyle \argmax\nolimits_{y\in\mathcal{Y}} 
& \string\displaystyle \\

  \argmax_{y\in\mathcal{Y}} % '\textstyle' is the default
& \argmax\limits_{y\in\mathcal{Y}}
& \string\textstyle \\

  \scriptstyle \argmax_{y\in\mathcal{Y}} 
& \scriptstyle \argmax\limits_{y\in\mathcal{Y}} 
& \string\scriptstyle \\

  \scriptscriptstyle \argmax_{y\in\mathcal{Y}}
& \scriptscriptstyle \argmax\limits_{y\in\mathcal{Y}} 
& \string\scriptscriptstyle 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .