I'm trying to compile the following code:
\documentclass{article}
\usepackage{amsmath}
\newcommand{\invexpsqrt}[1]{{#1}^{- \tfrac{1}{2}}}
\begin{document}
\begin{align}
\begin{split}
\rho_{out} &= \exp \left[ - \frac{1}{2} \left( x \cdot \gamma \cdot x + x' \cdot \gamma \cdot x' \right) + x \cdot \beta \cdot x' \right] \\
&= \exp \left[- \frac{1}{2} \left( V \gamma_D^{-\tfrac{1}{2}} y V^T \gamma_D V V^T \gamma_D^{- \tfrac{1}{2}} y + V \invexpsqrt{\gamma_D} y' V^T \gamma_D V V^T \invexpsqrt{\gamma_D} y' \right) \right. \\
&\qquad \qquad \left. + V \invexpsqrt{\gamma_D} y \beta V^T \invexpsqrt{\gamma_D} y' \right] \\
&= \exp \left[ - \frac{1}{2} \left( y \cdot y + y' \cdot y' \right) + y \cdot \left( \invexpsqrt{\gamma_D} V \beta V^T \invexpsqrt{\gamma_D} \right) \cdot y' \right] \\
&= \exp \left[ - \frac{1}{2} \left( y \cdot y + y' \cdot y' \right) + y \cdot \beta' \cdot y' \right]
\end{split}
\end{align}
\end{document}
to get a single, vertically centered equation number. However, my output comes out like this:
I have tried replacing the align environment with the equation environment and using \aligned within \equation. All of these yield the same result. Is there a command in my code that messes up the alignment, or is this problem caused by my compiler?
Edit: I just noted that another piece of code like this in the same file does not produce the same problem. Could it be that the second line of equations is too wide and therefore 'pushes' the numbering down?
align
somewhere when trying to troubleshoot this. As I said, I have used bothequation
andalign
, producing the same result.align
happened to be the last I tried, after which I didn't change it back.\invexpsqrt
to the example. Answering your own question is in general perfectly fine, or even recommended. Edit: A similar question was asked here: tex.stackexchange.com/questions/3579/…