# how to get limits UNDER argmax with substack, inside cases

When I use \substack together with \max, I get the limits UNDER the operator, which is what I want.

However, when I use \substack with \operatorname{argmax}, the limits are subscripts, which is not what I want.

Also, when I use \substack with \max inside of

\begin{cases}
...
\end{cases}


the limits are subscripts.

Is there a way to make the limits be UNDER \operatorname{argmax} inside of a "cases" environment?

My code (with undesirable behavior):

$\text{where } \pd{P[r][c]}{A[i][j]} = \begin{cases} 1 & i,j = \max_{\substack{1 \le i' \le 3 \\ 1 \le j' \le 3} } A[(r-1)\times 2+i'][(c- 1)\times 2+j']\\[30pt] 0 & \text{ else } \end{cases}$


Code that does put limits UNDER the operator:

$P[r][c] = \max_{ \substack{1 \le i \le 3 \\ 1 \le j \le 3} } A[(r-1)\times 2+i][(c-1)\times 2+j]$

• What if you use \operatorname{argmax} \limits ...? Mar 15, 2020 at 19:02
• I tried that, but I didn't know about the * that I needed, as you described in your answer below. Thanks!
– Joe
Mar 15, 2020 at 19:37
• You’re welcome .. Mar 15, 2020 at 19:38
• Load mathtools and use dcases, it runs the cells is display math style, normal cases use text style Mar 15, 2020 at 20:34

\operatorname*{argmax} \limits_{\substack{1 \le i' \le 3 \\ 1 \le j' \le 3}}

Note: \operatorname{} without the asterisk cannot accept the command \limits.
The command \limits should also fix your other problem.