PierreSenellart / apxproof

LaTeX package for automatically putting proof environments in appendix
LaTeX Project Public License v1.3c
23 stars 8 forks source link

Equations inside repeated theorems override \labels from the main text. #16

Closed kbauer closed 6 years ago

kbauer commented 6 years ago

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

Possible solution

Example

\documentclass{article}                        %
                                               %
\usepackage{apxproof}                          %
\usepackage{amsmath}                           % if amsmath is disabled,
\newtheoremrep{foobar}{FooBar}                 % the references are correct
                                               %
\begin{document}                               %
                                               %
\begin{foobar}                                 %
  \begin{equation}                             %
    References~to~this~equation~are~correct.   %
    \label{eq:correct}                         %
  \end{equation}                               %
\end{foobar}                                   %
                                               %
\begin{foobarrep}
  \begin{equation}
    References~here~are~broken.
    \label{eq:broken}
  \end{equation}
\end{foobarrep}

\begin{center}
  \begin{tabular}{lcc}
             & \texttt{eq:correct}    & \texttt{eq:broken} \\
    Expected & Eq.~(1)                & Eq.~(2) \\
    Obtained & Eq.~(\ref{eq:correct}) & Eq.~(\ref{eq:broken})
  \end{tabular}
\end{center}

\end{document}

image

PierreSenellart commented 6 years ago

Thanks for the fix, this is simple enough. Merged in 926c39b.