I have a list of equations with annotations like the one below:
\documentclass{scrartcl}
\usepackage{amsmath}
\begin{document}
\begin{align*}
aaaa &= 1 &&\text{for $X$} \\
bbbb &= 1 &&\text{for $Y$} \\
c &= 1 &&\text{for $Z$} \\
d &= 12 &&\text{for $Z$}
\end{align*}
\end{document}
Since the last two lines have the same annotation, I'd like to add a brace there and put the annotation next to the brace. I know that I can do that like this:
\documentclass{scrartcl}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\left. \begin{aligned}
c &= 1 \\
d &= 12 \\
\end{aligned} \right\} &&\text{for $Z$}
\end{align*}
\end{document}
But how to join the two? The last two lines will only be aligned among themselves, not with the first two. Is there a way out of this?
Thanks in advance.
