Currently, I am using gather and align environments when I want to write down several math equations in a single environment. When I have several of them, it works fine when there is a text between them, but the spacing is too much when there is no text between them:
\usepackage{mathtools}
\newcommand\algn[1]{\begin{align*}#1\end{align*}}
\newcommand\gthr[1]{\begin{gather*}#1\end{gather*}}
\newcommand{\ind}[1]{\mathbbold{#1}}
\DeclareMathOperator{\rank}{rank}
\newcommand{\trp}{\text{t}}
\DeclarePairedDelimiter\norm{\lVert}{\rVert}
\gthr{
\sum_{n\in\ind{n}}m_n
= \rank\langle \Lambda \rangle
= \rank\langle T\Lambda T^{\trp} \rangle
= \rank \langle \Delta^{1/2}A\Delta^{1/2} \rangle
= \rank \langle A \rangle
}
\algn{
f^{\trp}Af
& = f^{\trp}\Delta^{-1/2}(\Delta^{1/2}A\Delta^{1/2})\Delta^{-1/2}f\\
&= (T^{\trp}\Delta^{-1/2}f)^{\trp}\Lambda (T^{\trp}\Delta^{-1/2}f)\\
& = \sum_{r\in\ind{r}}\lambda_r (T_{,r}^{\trp}\Delta^{-1/2}f)^2\\
& = \sum_{n\in\ind{n}}\lambda_n \norm{P_n^{\trp}\Delta^{-1/2}f}^2
}
The top is the gather environment and the below is the align environment, and there is no text between them. I cannot incorporate the top equation in the align environment since I cannot center it properly. I want to reduce the spacing without using vspace every time. I have find a similar problem here Avoiding extra vertical space between groups of equation environments, but it did not work for me; when using align*, it ruined the horizontal positioning of the equations. Any help would be appreciated.
&
before the second =, but the general case is a bit harder\ind
,\rank
, ,\trp
, ...\gthr
and\algn
instead of the full environment form while losing in flexibility. By the way, use\mathrm{t}
instead of\text{t}
for the transpose.