I am using the theomac.sty file for being able to have the same theorem appear in several different places in the .tex file without having to copy it, and while still having the same numbering (so for example, the theorem statement can appear in a certain section, and then the proof can appear in an appendix with the statement of the theorem again).
The way it works is by using the following:
\begin{replemma}[\lemmaC]
lemma here
\end{replemma}
Then, whenever I want to paste the lemma again, I can use \lemmaC.
replemma is defined in the beginning of the .tex file as:
\let\replemma=\lemma
\let\endreplemma=\endlemma
\makeatletter
\@newtheoremWithMacro{replemma}{lemma}%
\makeatother
The problem I am having is two-folded.
1. If I have a footnote in the first appearance of the theorem, then this footnote is added every time I use \lemmaC. Still, I want the footnote to appear only in the first instantiation.
2. If I refer to an equation that appears in the lemma, then the equation is preceeded with the section number of the last appearance, instead of the first appearance (I use equations numbered with section). This means that everywhere I refer to an equation appearing in the lemma, it appears with an appendix prefix A.2 for example, instead of 4.2 (it first appears in section 4).
Any ideas how to fix these two problems?

