# Troubles in aligning terms under gather, aligned and split environments

I'm having a lot of troubles in aligning some terms in a complicated equation. This is probably a semi-trivial thing, but I don't get it (fssshhht!). Here's a MWE to show my problem:

\documentclass[11pt,letterpaper,twoside]{book}
\usepackage{nccmath,amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}

\begin{document}

\begin{gather*}
A + B + C + D \\[1ex]
\begin{aligned}
&= CAT &&+ BB + CC + DD + EE
\begin{split}
&&- a - b - c - d \\
&&- e - f + g \\
&&+ h - k
\end{split} \\[1ex]
&= FOOD,
\end{aligned}
\end{gather*}

\end{document}


The FOOD term should be aligned with the CAT term (from their equal sign), while the BB, a, e and h term should be aligned (from their front sign). Currently, this code gives a mess! What am I doing wrong here?

I tried the alignat environment, but it's worst. My troubles come from the last line, which should be aligned with the second line. Without the last line, this would be a trivial task (no need of the split environment)!

Does this go in the right direction?

\documentclass[11pt,letterpaper,twoside]{book}
\usepackage{nccmath,amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}

\begin{document}

\begin{gather*}
A + B + C + D \\[1ex]
\begin{aligned}
&= CAT \begin{aligned}[t]&+ BB + CC + DD + EE \\
&- a - b - c - d \\
&- e - f + g \\
&+ h - k\end{aligned}\\
&= FOOD,
\end{aligned}
\end{gather*}
\end{document}


• Oh, yes, this is what I'm trying to achieve. I didn't knew that [t] trick. I'm surprised by the double aligned environments. – Cham Dec 14 '19 at 5:02