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:

lemma here

Then, whenever I want to paste the lemma again, I can use \lemmaC.

replemma is defined in the beginning of the .tex file as:


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?


As egreg has mentioned, the thmtools package lets you handle both problems easily (refer to Section 1.4 Repeating theorems of the documentation). A little example:




\noindent\begin{minipage}{\textwidth}% just for the example
\section{Test section one}

The Diophantine\footnote{after  Diophantus of Alexandria} equation
  x^n + y^n = z^n,
where $x$, $y$, $z$, and $n$ are integers, has no nonzero solutions for  $n>2$.

\section{Test section two}


Equation~\ref{eq:1} in Theorem~\ref{thm:fermat}...


Notice the braces enclosing the redefinition of \footnote, to keep it local. I used a minipage only to shorten the example.


I don't know about theomac; but surrounding the repetition with

<the commands for repeating the theorem>

should neutralize the effect.

Consider using the very powerful package thmtools.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.