Here is my code:
\documentclass{beamer}
\usepackage{amsfonts}
\usepackage{amsmath}
\begin{document}
\frame{\titlepage}
\begin{frame}
\begin{gather}\label{equation1}
a^2 + b^2 = c^2
\end{gather}
Consider \eqref{equation1}. This is fine.
\end{frame}
\begin{frame}
But then:
\begin{gather}\label{equation2}
x^2 + y^2 = z^2\nonumber\\
r + s + t
\end{gather}
\begin{equation}
x = 2
\end{equation}
Equation (2) is referenced as \eqref{equation2}. Why???
\end{frame}
\end{document}
I do not understand why in the last line, \eqref(equation2) shows up as (3) despite clearly being designated as (2). How do I work around this in an efficient manner, particularly since I am going to have to code multiple slides with this sort of thing?
gatherblock, not at the beginning. – Johannes_B Feb 12 '17 at 08:21gather(andalign) environments for single-line displayed equations constitutes a form of typographic abuse. Useequationenvironments instead. See the posting What are the differences between $$, [, align, equation and displaymath for more information on this subject. – Mico Feb 12 '17 at 08:28\labelafter the second equation of yourgatherenvironment. – Paul Gaborit Feb 12 '17 at 08:30