Using a math operator inside a 'cases' environment

When I do this:

$$b_i = \begin{cases} arg \min_{\forall p \in B} d(a_i, p) & \text{if } d(a_i, b_i) < D_{max} \\ \text{undefined} & \text{otherwise} \end{cases}$$


the _ doesn't cause the following text to go below \min, but rather appear as a subscript. Is it possible to make a \min expression with the following text below it inside a cases environment?

does adding \displaystyle do it for you? id est:

$$b_i = \begin{cases} arg \displaystyle\min_{\forall p \in B} d(a_i, p) & \text{if } d(a_i, b_i) < D_{max} \\ \text{undefined} & \text{otherwise} \end{cases}$$

• Yes, it does. I didn't think I needed \displaystyle since I was already in an 'equation' environment, but I guess 'cases' takes it "out" of equation mode. Thanks! – David Doria Mar 17 '12 at 16:36
• @DavidDoria i think you can use the dcases environment instead of cases if you don't want it in text style, as described here – aeroNotAuto Mar 17 '12 at 16:42
• cases switches one size down, which means \displaystyle->\textstyle. In \textstyle, all sub/super-sripts are put on the left. – yo' Mar 17 '12 at 16:43

You can use commands \limits and \nolimits to control where the subscripts are places. As well, you might want the arg min look better, as shown in the following example (notice you have to declare the command \argmin yourself):

\documentclass{article}

\usepackage{amsmath,mathtools}

%% HERE
\DeclareMathOperator*{\argmin}{arg\,min}

\begin{document}

$$b_i = \begin{cases} %% HERE \argmin\limits_{\forall p \in B} d(a_i, p) & \text{if } d(a_i, b_i) < D_{max} \\ \text{undefined} & \text{otherwise} \end{cases}$$

\end{document}


You can omit the \limits command if you use dcases environment instead of cases. They differ in the math style inside -- dcases keep \displaystyle inside.

• You might also point to the dcases environment provided by mathtools. – egreg Mar 17 '12 at 16:41