PierreSenellart / apxproof

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

newenvironment not recognized inside a toappendix #55

Closed fsikora closed 7 months ago

fsikora commented 8 months ago

Hi,

It seems that an environment defined by newenvironment is not recognized anymore when used inside a toappendix block.

Here is a MWE :

\documentclass[runningheads,envcountsame]{llncs}

\usepackage{amsmath,amssymb}
\usepackage{apxproof} 
\usepackage{xcolor}

\newtheoremrep{theorem}{Theorem}
\newtheoremrep{claim}[theorem]{Claim}

\newenvironment{claimproof}[1][\proofname]{
  \pushQED{\qed}%
  \normalfont 
  \trivlist
  \item[\hskip\labelsep
        \color{black}\sffamily
    #1{.}]\ignorespaces
}{%
  \renewcommand\qedsymbol{\textcolor{black}{\ensuremath{\vartriangleleft}}}
  \popQED\endtrivlist%\@endpefalse
  \renewcommand\qedsymbol{\textcolor{black}{\ensuremath{\blacktriangleleft}}}
}

\begin{document}

\begin{claim}
    ok claim in text
\end{claim}
\begin{claimproof}
    the proof
\end{claimproof}

\begin{toappendix}

\begin{claim}
    claim in appendix
\end{claim}
\begin{claimproof}
     LaTeX Error: Environment claimproof undefined.
\end{claimproof}

\end{toappendix}

\end{document}

It is solved if I copy paste the newenvironment definition inside the toappendix block (but ugly :)).

PierreSenellart commented 7 months ago

The problem was not general with arbitrary environments but specific to the claimproof environment, when it is user-defined and not defined by the document class as in the lipics-v2021 document class. This should be fixed in 1dd0138. Please try https://github.com/PierreSenellart/apxproof/blob/develop/apxproof.sty