Description
When a \label is placed inside a displayed equation environment (equation or equation*) in a frame with overlays, the equation shifts horizontally when advancing from one overlay to the next. The shift does not occur when \label is absent.
Minimal reproducible example
\documentclass{beamer}
\begin{document}
\begin{frame}{Test}
\begin{equation*}\label{E:Test}
A,
\end{equation*}
\pause
Text.
\end{frame}
\end{document}
Observed behavior
On overlay 1, the equation appears at one horizontal position. After advancing to overlay 2, the equation shifts slightly to the right.
Expected behavior
The equation should remain at the same horizontal position across all overlays.
Conditions identified so far
The following conditions trigger the bug (the list may not be exhaustive):
\label present inside equation or equation* — this appears to be a necessary condition in all cases identified so far;
- the equation ends with
, or ; (\mathpunct), or contains an operator defined via \DeclareMathOperator.
The following conditions prevent the bug:
\label removed from the equation environment;
\label moved to the very end of the equation, just before \end{equation*} (see workaround below).
Suspected cause
During the overlay retypesetting pass, \label triggers a write to the .aux file. This side effect appears to disturb the internal state of display math mode at the moment the final content is processed. Elements that involve spacing adjustments via \mskip — such as \mathpunct characters (,, ;) and operators defined via \DeclareMathOperator — appear to be sensitive to this disturbance, whereas . (which is not a \mathpunct in math mode) is not.
Workaround
Move \label to the end of the equation, just before \end{equation*}:
\begin{equation*}
A,
\label{E:Test}
\end{equation*}
Alternatively, remove \label from equation* entirely, since an unnumbered equation cannot be meaningfully referenced. Note, however, that keeping labels in equation* in slides that share code with a book may be a legitimate use case.
Environment
- MiKTeX (updated), March 2026
- The problem was not present in August 2025 and began occurring by March 2026 or before, suggesting it was introduced by an update to Beamer or one of its dependencies in that interval.
References
This bug was first documented on TeX Stack Exchange: https://tex.stackexchange.com/questions/761045/unwanted-horizontal-shift-of-equation-on-overlay-when-label-is-present-and-equ
Description
When a
\labelis placed inside a displayed equation environment (equationorequation*) in a frame with overlays, the equation shifts horizontally when advancing from one overlay to the next. The shift does not occur when\labelis absent.Minimal reproducible example
Observed behavior
On overlay 1, the equation appears at one horizontal position. After advancing to overlay 2, the equation shifts slightly to the right.
Expected behavior
The equation should remain at the same horizontal position across all overlays.
Conditions identified so far
The following conditions trigger the bug (the list may not be exhaustive):
\labelpresent insideequationorequation*— this appears to be a necessary condition in all cases identified so far;,or;(\mathpunct), or contains an operator defined via\DeclareMathOperator.The following conditions prevent the bug:
\labelremoved from the equation environment;\labelmoved to the very end of the equation, just before\end{equation*}(see workaround below).Suspected cause
During the overlay retypesetting pass,
\labeltriggers a write to the.auxfile. This side effect appears to disturb the internal state of display math mode at the moment the final content is processed. Elements that involve spacing adjustments via\mskip— such as\mathpunctcharacters (,,;) and operators defined via\DeclareMathOperator— appear to be sensitive to this disturbance, whereas.(which is not a\mathpunctin math mode) is not.Workaround
Move
\labelto the end of the equation, just before\end{equation*}:Alternatively, remove
\labelfromequation*entirely, since an unnumbered equation cannot be meaningfully referenced. Note, however, that keeping labels inequation*in slides that share code with a book may be a legitimate use case.Environment
References
This bug was first documented on TeX Stack Exchange: https://tex.stackexchange.com/questions/761045/unwanted-horizontal-shift-of-equation-on-overlay-when-label-is-present-and-equ