I am trying to create a set of equations with curly braces (like cases), each with their own set of numbers derived from the subsection (such as can be done with equations using \numberwithin{equation}{subsection}
).
I get a good result where I want one equation number representing all cases of the equation (code below).
\begin{equation}
\mathbb(E)(X) = \int_{-\infty}^{\infty} xdF(x) =
\left\{ \begin{array}{lll}
\sum_{x \in \mathcal{X}} xf_{X}(x) & =\sum_{x \in \mathcal{X}}x \mathbb{P}(X=x) &\text{ if } X \text{ is discrete}\\
\\
\int_{-\infty}^{\infty} xf_{X}(x)dx & &\text{ if } X \text{ is continuous}
\end{array}
\right.
\end{equation}
What can I do to to have each of the cases numbered individually?
I have tried align
and numcase
s, but each of them has some problem – either the equation or the text aligns right, or the spacing goes awry.
Would appreciate some help for the specific example above, with
-
Equation aligned to left of page
-
All text within cells left aligned
-
Equation numbers on extreme right
-
An empty cell in the 2nd case and
-
A blank line in between the two cases.
Best Answer
Another solution (and numbering) with the
empheq
package (which loadsmathtools
, which loadsamsmath
):