I have the following code in \documentclass{beamer},
\documentclass{beamer}
\begin{document}
\begin{frame}
\texttt{align} environment:
\begin{align}
\begin{bmatrix}
x\\y\\z
\end{bmatrix}&=
\begin{bmatrix}
1&&\\&2&\\&&3
\end{bmatrix}
\begin{bmatrix}
1\\2\\3
\end{bmatrix} \\
&=
\label{eq:4}
\begin{bmatrix}
1&&\\&2&\\&&3
\end{bmatrix}
\begin{bmatrix}
d\\e\\f
\end{bmatrix}\\
\label{eq:1}
a&=b
\end{align}
\texttt{equation} environment:
\begin{equation}
\label{eq:5}
a^{2}+b^{2}=c^{2}
\end{equation}
\end{frame}
\end{document}
which gives the following slide.
And we can see that the last equation number does not line up. I did not have such a problem if I used \documentclass{article} instead.
Why is this happening, and how can I fix this?


\tag{a\rlap{\smash{\rule[-10cm]{0.4pt}{12cm}}}}to the first row in the align, the problem is easily seen. – daleif Jan 09 '18 at 08:30equationis redefined to begather, becausegathershows the same problem. Might want to add gather as an example as well. – daleif Jan 09 '18 at 08:32frameto do nothing (\renewenvironment) then the placement is correct. We probably need some of thebeamerpeople to have a look at this. – daleif Jan 09 '18 at 08:37\labelthat does something it should not? Just checked,\labelseems to leave a space behind. – daleif Jan 09 '18 at 08:44\labelwhat moves everything. Out comment all\labels, and it looks like it should. – daleif Jan 09 '18 at 08:46\labelafter some checking! – davyjones Jan 09 '18 at 08:47eq:4there, move it to be the first on the row, then everything is ok again – daleif Jan 09 '18 at 08:47\labelprobably leaves a "whatsit", which=and the matrix reacts to and this creates an extra small space. I'll add that as an answer – daleif Jan 09 '18 at 08:48