# aligned inside align: what's causing the ugly whitespace?

I'm trying to use aligned inside align in order to split/align an equation inside a global align.

My code is:

\begin{align}
\vert A \vert &\leq  \frac{1}{\theta^{3}} \int_{u=0}^t  \left|  \int_{s=0}^u c(s) \frac{ \left(  G^{(1)} (ds)  - G^{(2)} (ds)\right)}{H^{(2)}(s)}\right| \left| H^{(1)}(u)  -H^{(2)}(u)  \right|   G^{(1)}(du)\\
&\leq \begin{aligned}[t]
\frac{1}{2\theta^{3}} &\int_{u=0}^t \Biggl\{  \left(  \int_0^u c(s)  \frac{ \left(  G^{(1)} (ds)  - G^{(2)} (ds)\right)}{H^{(2)}(s)}  \right)^2\\
&+\left( H^{(1)}(u)  -H^{(2)}(u)  \right)^2 \Biggr\}  G^{(1)}(du)\\
\end{aligned}\\
&\leq \beta \left( \frac{2}{\theta^{7}} \|G^{(1)} - G^{(2)} \|_{[0,\tau]}^2 + \|H^{(1)} - H^{(2)} \|_{[0,\tau]}^2\right).
\end{align}


However this results in a very unaesthetic whitespace. Why? And I'm feeling like this is not the best approach so how should I do that?

• You haven't provided a full code but given that align usually numbers equations (even if your snapshot doesn't show the equation numbers) I'd say that the first line is simply too long, and the equation number of the first line is being accommodated below it, hence the space. But again, without a complete code it's impossible to say. Jun 23 at 12:54
• Do you mean complete code including the preamble and class ? Because the snippet's code is included. Equation numbers are disabled and I don't think the line is too long because the hbox isn't overfull (as verified with draft mode). I can provide a mwe but because it won't be the same fonts it will not match perfectly. Jun 23 at 13:12
• In a standard set-up, your code does not produce the output you show, so whatever is going on is due to code you are withholding. If I copy your snippet in a minimal document I get precisely the same spacing, but with equation numbers, which BTW explains perfectly where the spacing is coming from. The line does not need to be overfull, just too long to accommodate the equation number on the same line. You say that the equation numbers are disabled, and without knowing how you are doing it we can only guess. Jun 23 at 13:21
• Equation numbers are disabled with \mathtoolsset{showonlyrefs, mathic}. So it would mean the equation number is stil "there". Just invisible? I tested with align* and everything is perfect. I learned something... Jun 23 at 13:35
• The first line is too long, so the equation number has to be lowered. The effect is exacerbated by the top aligned. Jun 23 at 13:37

I don't think the spacing issue you've come across is related to the use (or non-use) of the showonlyrefs option of the mathtools package. Instead, it is -- as already pointed out by @egreg in a comment -- caused by the fact that the first line is too long. The remedy? Either introduce an explicit line break, or be a bit more circumspect about how the large delimiters are displayed and spaced.

The following screenshot first shows the three equations with showonlyrefs=true, and then with showonlyrefs=false. The underlying equations are the same in both cases. Note the use of the \DeclarePairedDelimiter macro of the mathtools package to create macros called \abs and \norm as well as the avoidance of \left and \right.

\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
\begin{document}

\noindent with \verb+showonlyrefs=true+
\mathtoolsset{showonlyrefs=true}
\begin{align}
\abs{A} &\leq  \frac{1}{\theta^{3}} \int_{u=0}^t
\abs[\bigg]{ \int_{s=0}^u \! c(s)
\frac{ G^{(1)} (ds)  - G^{(2)} (ds)}{H^{(2)}(s)}}
\abs[\big]{ H^{(1)}(u) - H^{(2)}(u) } \, G^{(1)} (du) \\
&\leq \frac{1}{2\theta^{3}} \int_{u=0}^t
\begin{aligned}[t]
&\biggl\{ \biggl( \int_0^u c(s)
\frac{  G^{(1)} (ds)  - G^{(2)} (ds)}{H^{(2)}(s)}  \biggr)^{\!2} \\
&\quad+\bigl( H^{(1)}(u) - H^{(2)}(u)  \bigr)^2 \biggr\}\,  G^{(1)}(du)
\end{aligned}\\
&\leq \beta \Bigl( \frac{2}{\theta^{7}}
\norm[\big]{G^{(1)} - G^{(2)} }_{[0,\tau]}^2 +
\norm[\big]{H^{(1)} - H^{(2)} }_{[0,\tau]}^2 \Bigr)\,.
\end{align}

\bigskip
\noindent with \verb+showonlyrefs=false+
\mathtoolsset{showonlyrefs=false}
\begin{align}
\abs{A} &\leq  \frac{1}{\theta^{3}} \int_{u=0}^t
\abs[\bigg]{ \int_{s=0}^u \! c(s)
\frac{ G^{(1)} (ds)  - G^{(2)} (ds)}{H^{(2)}(s)}}
\abs[\big]{ H^{(1)}(u) - H^{(2)}(u) } \, G^{(1)} (du) \\
&\leq \frac{1}{2\theta^{3}} \int_{u=0}^t
\begin{aligned}[t]
&\biggl\{ \biggl( \int_0^u c(s)
\frac{  G^{(1)} (ds)  - G^{(2)} (ds)}{H^{(2)}(s)}  \biggr)^{\!2} \\
&\quad+\bigl( H^{(1)}(u) - H^{(2)}(u)  \bigr)^2 \biggr\}\,  G^{(1)}(du)
\end{aligned}\\
&\leq \beta \Bigl( \frac{2}{\theta^{7}}
\norm[\big]{G^{(1)} - G^{(2)} }_{[0,\tau]}^2 +
\norm[\big]{H^{(1)} - H^{(2)} }_{[0,\tau]}^2 \Bigr)\,.
\end{align}
\end{document}