# Align multiple-line equation

I tried this code and it created a large space like this

\begin{align}
&C^\text {UL} &= \log_2\left|{\bf I}_M + \frac{\rho_\text{ul}}{K}{\bf H}{\bf H}^\dagger\right|\\
%\end{align}
%\begin{align}
&C^\text {DL} &= \log_2\left|{\bf I}_K + \frac{\rho_\text{dl}}{M}{\bf H}{\bf H}^\dagger\right| \nonumber \\
&&= \log_2\left|{\bf I}_M + \frac{\rho_\text{dl}}{M}{\bf H}{\bf H}^\dagger\right|
\end{align}


How can I fix this?

• Welcome to TeX.SX!. Please provide a full MWE. – Steradiant Jun 4 at 15:41
• Rather use \mathbf{H} than {\bf H}. – Werner Jun 4 at 15:48

Delete the & in front of the lines

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align}
C^\text {UL} &= \log_2\left|{\mathbf I}_M + \frac{\rho_\text{ul}}{K}{\mathbf H}{\mathbf H}^\dagger\right|\\
C^\text {DL} &= \log_2\left|{\mathbf I}_K + \frac{\rho_\text{dl}}{M}{\mathbf H}{\mathbf H}^\dagger\right| \nonumber \\
&= \log_2\left|{\mathbf I}_M + \frac{\rho_\text{dl}}{M}{\mathbf H}{\mathbf H}^\dagger\right|
\end{align}
\end{document}


• That works! Thank you very much – hidaimrd Jun 4 at 15:47
• note \bf is not defined by default in LaTeX, use \mathbf{I} – David Carlisle Jun 4 at 15:48
• Thank you, I will fix that. I'm a beginner :)) – hidaimrd Jun 4 at 15:53
• If you like my answer I'd be happy if you accept it :) – Steradiant Jun 4 at 15:57
• Please, fix \bf. – egreg Jun 4 at 20:02

In addition to (a) removing the detrimental & symbols at the start of each line and (b) replacing {\bf ...} with \mathbf{...}, you may also want to (c) employ \mathrm instead of \text -- just in case this equation ever occurs inside a theorem-like environment -- and (d) reduce the heights of the absolute-value fences. For the final objective, I suggest you define an "absolute value" macro with the help of the \DeclarePairedDelimiter macro of the mathtools package.

\documentclass{article}
\usepackage{mathtools} % for '\DeclarePairedDelimiter' macro
\DeclarePairedDelimiter\abs\lvert\rvert
\begin{document}
\begin{align}
C^\mathrm{UL} &= \log_2\abs[\big]{\mathbf{I}_M
+ \frac{\rho_{\mathrm{ul}}}{K} \mathbf{H}\mathbf{H}^\dagger} \\
C^\mathrm{DL} &= \log_2\abs[\big]{\mathbf{I}_K
+ \frac{\rho_{\mathrm{dl}}}{M} \mathbf{H}\mathbf{H}^\dagger} \nonumber \\
&= \log_2\abs[\big]{\mathbf{I}_M
+ \frac{\rho_{\mathrm{dl}}}{M} \mathbf{H}\mathbf{H}^\dagger}
\end{align}
\end{document}

• That helps me a lot. Thank you – hidaimrd Jun 4 at 16:18

Rather than align, use the alignat environment. The alignat environment will need an additional argument for the maximum number of left-right column-pairs you want to use, but giving a far larger number is not wrong.

\begin{alignat}{2}
&C^\text {UL} &= \log_2\left|{\bf I}_M + \frac{\rho_\text{ul}}{K}{\bf H}{\bf H}^\dagger\right|\\
&C^\text {DL} &= \log_2\left|{\bf I}_K + \frac{\rho_\text{dl}}{M}{\bf H}{\bf H}^\dagger\right| \nonumber \\
&&= \log_2\left|{\bf I}_M + \frac{\rho_\text{dl}}{M}{\bf H}{\bf H}^\dagger\right|
\end{alignat}


The difference to me is that align wants to make equal spacing between each column-pair, whereas alignat will move them as close together as the alignment will allow, then center the whole thing.

Be sure where you place the alignment markers as the left-right aligned nature of the columns will otherwise mess up your output.