# Numbering cases within cases

I am stuck with a formatting problem: I have a system with cases within cases, and I would like each subcase to be numbered. Here is a MWE of what I got for the moment:

\documentclass[12pt, a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\begin{document}

\begin{subequations} \label{eq:systm}
\begin{align}[left={S=\empheqlbrace}]
S_1= {}& \begin{cases}
\vspace{4pt}
A + B + C & \text{if } a < 1, \\
\vspace{4pt}
D + 2(\sum\limits_{i} EF + \\~~~~
2 GH ) + K-L & \text{if }a=1.
\end{cases} \\
S_2 = {}& 1 \\
S_3= {}& \begin{cases}
\sum\limits_{i} I + \sum\limits_{i} J & \text{if } a = 0 \\
0 & \text{otherwise.}
\end{cases}
\end{align}
\end{subequations}

\end{document} I would like (if possible) the first line to be numbered 1.1a, the second (with the split) 1.1b, the third 1.2, the fourth 1.3a and the last one 1.3b (or something of this type...)

I also really need the splits to be taken in account (in fact I'm dealing with very long equations).

Can you help ? Thank you :)

My suggestion would be to \tag the respective equations with the necessary numbering scheme. You can use combinations of \theequation, for example, in order to make things consistent with the remainder of the document, and step equation before/after the aligned equations: \documentclass{article}

\begin{document}

\begin{alignat}{2}[left={S=\empheqlbrace}]
& A + B + C & \text{if $a < 1$}, \tag{1.1a} \\
S_1 = \smash{\left\{\renewcommand{\arraystretch}{1.2}
\begin{array}{@{}c@{}}\mathstrut\\\mathstrut\\\mathstrut\end{array}\right.\kern-\nulldelimiterspace}
& D + 2\bigl( \textstyle\sum_i EF + \nonumber \\
& \quad 2 GH \bigr) + K - L & \text{if $a = 1$}. \tag{1.1b} \\
S_2 = \mathrlap{1}
\hphantom{\left\{
\begin{array}{@{}c@{}}\mathstrut\\\mathstrut\end{array}\right.\kern-\nulldelimiterspace}& \tag{1.2} \\
\raisebox{-.6\normalbaselineskip}[0pt][0pt]{$S_3 = \smash{\left\{ \begin{array}{@{}c@{}}\mathstrut\\\mathstrut\end{array}\right.\kern-\nulldelimiterspace}$}
& \textstyle\sum_i I + \sum_i J & \text{if $a = 0$} \tag{1.3a} \\
\end{alignat}

\end{document}


As an extremely partial answer, I note that subequationsenvironement can be nested with amsmath. Playing with counters allows to obtain the desired numbering. The obvious and important unsolved problem is the outer brace.

\documentclass[12pt, a4paper]{article}
\usepackage{amsmath}
\begin{document}
\begin{subequations}
\renewcommand{\theequation}{\theparentequation.\arabic{equation}}
\begin{subequations}
\renewcommand{\theequation}{\theparentequation.\alph{equation}}
\begin{equation}
a = b
\end{equation}
\end{subequations}
\begin{subequations}
\renewcommand{\theequation}{\theparentequation.\alph{equation}}
\begin{equation}
a = b
\end{equation}
\end{subequations}
\end{subequations}
\end{document} • For the outer brace, an array environment with \left\{ and \right. should work. – Bibi Dec 10 '15 at 16:33
• Hum. I do not know how to proceed on the basis on my rough sketch and your suggestion. – Denis Dec 10 '15 at 16:40