# Equation number in first line of nested align

I have the following nested align structure, where I would like to have an equation number appear on the first line only. As far as I understand, the position of the equation number is controlled with [b] and [t]. However, even if I specify [t], the number appears at the bottom (see )

As the second example works fine, I suspect it has something to do with the length of the equation. However, the space where the number should be is not occupied, so I don't understand where the problem is comming from.

Note: This is part of larger problem with align I have inside a latex template I am using for my thesis. Unfortunately I cannot reproduce this error outside the template. It looks like , in case this is familiar to anybody.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align}
\begin{aligned} [t]
E_{el} &  = (\sum \mathbf{E_{comp.}} + \sum E_{ref.}) \cdot CI_{el} \\
& = (\sum \mathbf{E_{comp.}} + \sum (84.74 \cdot e^{-0.02 \cdot \mathbf{T_{outflow}}})) \cdot CI_{el} \\
\end{aligned} \\
& \text{where} \nonumber \\
&  E_{komp.} \text{ is the energy demand of compressors} \nonumber
\end{align}

\begin{align}
\begin{aligned} [t]
E &  = B + C \\
& =B + c \cdot x \\
\end{aligned} \\
& \text{where} \nonumber \\
&  E \text{ is a variable} \nonumber
\end{align}
\end{document}

• You are correct that the location of the equation number is affected by the width of the longest line of the aligned. The equation number here has been moved from its intended location; there is a defined mechanism for changing the position in such a case, and it is documented in the amsmath user guide (texdoc amsldoc). The command is \raisetag and it's described on page 10. – barbara beeton Jun 25 at 18:59
• The typesetting is inconsistent: E appears boldface and italic when apparently it means the same thing; “comp.” becomes “komp.”; the subscripts are sometimes boldface and sometimes italic. You should fix this. – egreg Jun 25 at 22:18
• @egreg you're right it does not look too nice. I fixed by substituting \mathbf with \boldsymbol as recommended here tex.stackexchange.com/questions/14395/bold-italic-vectors/14400 if anybody has the same problem. – Lucia Layritz Jun 28 at 7:20

I propose this solution based on alignat and a \makebox[0pt] to fool LaTeX:

\documentclass{article}
\usepackage{amsmath, nccmath}

\begin{document}

\begin{fleqn}
\begin{alignat}{2}
& \text{Electricity (Process):} & \quad &
\begin{aligned} [t]
E_{el} & = (\sum \mathbf{E_{comp.}} + \sum E_{ref.}) \cdot CI_{el} \\
& =\Bigl (\sum \mathbf{E_{comp.}} + \sum (84.74 \cdot e^{-0.02 \cdot \mathbf{T_{outflow}}})\Bigr)\cdot \makebox[0pt][l]{$CI_{el}$} \\
\end{aligned} \\[1ex]
&\text{where} & & E_\mathrm{komp.} \text{ is the energy demand of compressors} \notag
\end{alignat}
\end{fleqn}

\end{document}


• This worked! It did not solve my original problem (which is fine, as it was not really part of the question) but gave me no ideas to work on this. Thanks – Lucia Layritz Jun 28 at 7:17
• *new, not no :) – Lucia Layritz Jul 16 at 7:44