The \label of equations is repeated in the appendix, if amsmath is loaded.
As a consequence, all \refs to equations in foobarrep environment incorrectly refer to the appendix.
Notes
The error doesn't become visible until the second compilation pass.
apxproof already redefines \label to \@gobble.
amsmath environments, including the redefined equation, redefines \label to \label@in@display,
which invokes \ltx@label, which is defined as \let\ltx@label\label in amsmath.dtx.
Possible solution
Redefine \let\label@in@display\@gobble, same as with \label, in the repetitions.
The
\label
of equations is repeated in the appendix, ifamsmath
is loaded. As a consequence, all\ref
s to equations infoobarrep
environment incorrectly refer to the appendix.Notes
apxproof
already redefines\label
to\@gobble
.amsmath
environments, including the redefinedequation
, redefines\label
to\label@in@display
, which invokes\ltx@label
, which is defined as\let\ltx@label\label
inamsmath.dtx
.Possible solution
\let\label@in@display\@gobble
, same as with\label
, in the repetitions.Example