# Substack in brackets

I have the following code:

\begin{dcases}
\left\lbrace  j\in C/\!\!\!\!\!\!\!\!
\bigcup_{\substack{\scriptscriptstyle \forall c' \text{ s.t.\@}\\
\scriptscriptstyle \pi_{ic'}(\alpha)>\pi_{ic}(\alpha)}}
\!\!\!\! C'\ \middle|\ \omega_{ij}(\alpha)>0 \right\rbrace  & \mbox{if } \mathtt{max}_p(S_0) = \emptyset\\[5pt]

\left\lbrace  j\in C/\!\!\!\!\!\!\!\!\bigcup_{\substack{\scriptscriptstyle \forall c' \text{ s.t.\@}\\
\scriptscriptstyle c'\in\mathtt{isucc}(C),\\
\scriptscriptstyle \nexists c'' \text{ s.t.\@} \\
\scriptscriptstyle \pi_{ic''}(\alpha)>\pi_{ic'}(\alpha)}}\!\!\!\!
C'\ \middle|\ \omega_{ij}(\alpha)>0 \right\rbrace &  \mbox{otherwise}
\end{dcases}&&

It produces the following results:

The whole thing is very ugly. How can it be cleaned?

In particular, in each case in dcases, the curely brackets take up too much space. Maybe if they did not expand to the top of the equations as much as the bottom (as needed because of substack), it would have looked cleaner.

Also please suggest any better way to produce this result in a cleaner form.

There is no need that the braces cover also those complicated conditions:

\documentclass{article}
\usepackage{mathtools,amssymb}

\begin{document}

$$\begin{dcases} \biggl\lbrace j\in C\bigg/ \mspace{-18mu} \bigcup_{\scriptscriptstyle\substack{ \forall c' \text{ s.t.}\\ \pi_{ic'}(\alpha)>\pi_{ic}(\alpha) }} \mspace{-18mu} C' \biggm| \omega_{ij}(\alpha)>0 \biggr\rbrace & \text{if } \mathtt{max}_p(S_0) = \emptyset \\[5pt] \biggl\lbrace j\in C\bigg/ \mspace{-18mu} \bigcup_{\scriptscriptstyle\substack{ \forall c' \text{ s.t.}\\ c'\in\mathtt{isucc}(C),\\ \nexists c'' \text{ s.t.}\\ \pi_{ic''}(\alpha)>\pi_{ic'}(\alpha) }} \mspace{-18mu} C' \biggm| \omega_{ij}(\alpha)>0 \biggr\rbrace & \text{otherwise} \end{dcases}$$

\end{document}

• +1 for mspace. Much better than \!\!\!\!\!\!\!\! – Ali Jun 4 '15 at 9:49

Personally I fill prefer the following form:

It is obtained width following code:

\documentclass{article}
\usepackage{mathtools,amssymb}

\begin{document}
$$\begin{dcases} \begin{tabular}[t]{r|l} j\in \dfrac{C}{\bigcup\limits_{\substack{ \forall c' \text{ s.t.}\\ \pi_{ic'}(\alpha)>\pi_{ic}(\alpha) \hphantom{''}%just for centering }} C'} & \omega_{ij}(\alpha)>0 \end{tabular} & \text{if } \mathtt{max}_p(S_0) = \emptyset \\ \begin{tabular}[t]{r|l} j\in \dfrac{C}{\bigcup\limits_{\substack{ \forall c' \text{ s.t.}\\ c'\in\mathtt{isucc}(C),\\ \nexists c'' \text{ s.t.}\\ \pi_{ic''}(\alpha)>\pi_{ic'}(\alpha) }} C'} & \omega_{ij}(\alpha)>0 \end{tabular} & \text{otherwise} \end{dcases}$$
\end{document}

If you prefer to have each part of cases in curly braces, than before and after each tabular add \left{ and right} respectively.

I hope that I understand your equation ...

Edit: With added array package (in poreamble), you can rewrite both tabular environments in:

\begin{tabular}[t]{>{$}r<{$}|>{$}l<{$}}

and than omit $...$ in each cell of tabular. This simplify writing your equation a little bit.