Can the following be achieved using just amsmath
and mathtools
? (If not, what other tools do I need?)
I have a collection of equations
\begin{align}
A &= B \\
C &= D \\
E &= F
\end{align}
I want the following display:
- The three equations are all aligned at the
=
sign (like above) - The equation numbers for the first two are "subequations", that is the first equation is numbered (1a), the second (1b), but the third (2). (The numbering should be dynamical, I don't want to hard-code an equation number that I'd have to change every time.)
-
Since I am already putting the equation number on the left, I want to group the first two equations and mark them with a brace. Something similar to what can be done with
\begin{equation*} \left.\begin{aligned} A &= B\\ C &= D \end{aligned}\right\}\text{Some description} \end{equation*}
I know how to do each of 1, 2, and 3 separately. I am at a loss on how to put any two of them together. I would love to know how to achieve all three at the same time.
Edit: To do 1 and 2 together, I can use one of these answers.
Edit 2: A partial solution toward doing 1 and 3 together is to use the empheq
package as described here. However best as I can tell the brace is an "all or nothing" thing. I can't just brace the first two out of three expressions.
Best Answer
The following is taken from Mixed (sub)equation numbering within an array (which satisfies 1 & 2), with the addition of grouping via braces (satisfying 3):
For grouping an odd number of equations, insert a
\smash
edarray
in the middle equation. For an even number of equations, insert a\smash
edarray
in the equation just below the middle, and move it up.5\normalbaselineskip+.5\jot
, putting it right in the middle (vertically).The
array
has a@{}c@{}
column specification, thereby have width zero. However, the\nulldelimiterspace
on the left (from\left.
) pushes it slightly away from the equations. The vertical line skip of\\[\jot]
within eacharray
is to maintain the same vertical height as that ofalign
.