Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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:

\documentclass{article}
\usepackage{amsmath,amsthm}
\usepackage{thmtools,thm-restate}

\declaretheorem{theorem}
\numberwithin{equation}{section}

\begin{document}

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

\begin{restatable}{theorem}{lastfermat}
\label{thm:fermat}%
The Diophantine\footnote{after  Diophantus of Alexandria} equation
\begin{equation}\label{eq:1}
  x^n + y^n = z^n,
\end{equation}
where $x$, $y$, $z$, and $n$ are integers, has no nonzero solutions for  $n>2$.
\end{restatable}

\section{Test section two}

{\renewcommand\footnote[1]{}\lastfermat*}

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

\end{document}

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

share|improve this answer

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

\begingroup\renewcommand\footnote[1]{}
<the commands for repeating the theorem>
\endgroup

should neutralize the effect.

Consider using the very powerful package thmtools.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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