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.

Often in my papers I want to mention theorems in the introduction that are introduced in more detail and proved in a later section.

I'd like to include the statement of these theorems twice over, each time numbered as the theorem would naturally appear in its later section.

My current solution (using amsthm) is, e.g.

%(in the introduction)
\newtheorem*{thm:associativity}{Theorem \ref{thm:associativity}}
\begin{thm:associativity}
Lorem ipsum ...
\end{thm:associativity}

%(in a later section)
\begin{thm}
\label{thm:associativity}
Lorem ipsum ...
\end{thm}

Can anyone think of a cleaner solution?

share|improve this question
    
@EyalRozenberg, since there are already quite a few answers directed at the question as stated, I think that starting a new question will get better answers. (Link to it from here!) Of course, you're also welcome to edit as you please here. –  Scott Morrison Dec 22 '11 at 19:31
    
Although I've suggested an answer, I've noticed sometimes you need more from a restatement environment then the question author is asking for... have a look at this extension question of mine. –  einpoklum Dec 22 '11 at 20:14
add comment

8 Answers 8

up vote 17 down vote accepted

If you want to allow yourself to vary the text between the two occurrences, here's an alternative:

\documentclass{article}

\usepackage{amsthm}

\makeatletter
\newtheorem*{rep@theorem}{\rep@title}
\newcommand{\newreptheorem}[2]{%
\newenvironment{rep#1}[1]{%
 \def\rep@title{#2 \ref{##1}}%
 \begin{rep@theorem}}%
 {\end{rep@theorem}}}
\makeatother


\newtheorem{theorem}{Theorem}
\newreptheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newreptheorem{lemma}{Lemma}

\begin{document}

\begin{reptheorem}{myAmazingTheorem}
That theorem again
\end{reptheorem}

\begin{theorem}
\label{myAmazingTheorem}
A theorem
\end{theorem}
\begin{lemma}
\label{anInsignificantLemma}
A lemma
\end{lemma}

\begin{replemma}{anInsignificantLemma}
That theorem again
\end{replemma}


\end{document}

Probably needs a little tweaking to suit different theorem styles and the like.

share|improve this answer
    
@Andrew: I'm a bit confused by your code. Can you change some of the environment/labels to not be thm so the flow is a bit more obvious? (Or maybe a word on what your code is actually doing? I don't think I am parsing it quite right.) –  Willie Wong Jul 28 '10 at 11:11
    
@Willie Wong: Is that better? The idea is that a dummy theorem (with no numbering) is created ('rep@theorem' in the current version) and when we call it then we modify the title to the right thing (the 'name' and the supplied reference). –  Loop Space Jul 28 '10 at 11:27
    
Ah, I understand now. Thanks for the clarification. This is a very nice solution. –  Willie Wong Jul 28 '10 at 13:16
    
I would use a starred version of \ref in your answer; it feels a bit weird to have a link in the theorem, if you're using hyperref. –  Mateus Araújo Sep 2 '10 at 5:36
1  
@Andrew: A small problem with your solution is that \newreptheorem doesn't respect the current theorem style selected with \theoremstyle. I suggest to replace the block between \makeatletter and \makeatother by the following code to fix that: \newcommand{\newreptheorem}[2]{\newtheorem*{rep@#1}{\rep@title}\newenvironment{‌​rep#1}[1]{\def\rep@title{#2 \ref*{##1}}\begin{rep@#1}}{\end{rep@#1}}} –  Michael Ummels Apr 28 '11 at 12:15
show 3 more comments

What about the thmtools bundle? Check out page 6 of the guide: there's a 'restatable' environment.

share|improve this answer
    
This seems to be the best of the suggested options by far. In particular, it is the only suggested solution that doesn't involve duplicating the text of the theorem. Unfortunately, I can't get the starred command (\firsteuclid* in the example) to work with hyperref. –  yasmar May 28 at 12:10
add comment

Here's a solution I like even though it's not very clever. You simply temporarily redefine \thetheorem (or in your case, \thethm):

% in the introduction
{
\renewcommand{\thetheorem}{\ref{thm:associativity}}
\begin{theorem}
  Lorem ipsum ...
\end{theorem}
\addtocounter{theorem}{-1}
} % note: these braces are here to take advantage of LaTeX scoping ... 
  % \thetheorem is returned to its rightful definition outside of this group

% elsewhere
\begin{theorem} \label{thm:associativity}
  Lorem ipsum ...
\end{theorem}
share|improve this answer
add comment

Here is how I do it:

\documentclass{article}

\usepackage{amsthm}

    \theoremstyle{plain}
    \newtheorem{thm}{Theorem}[section]


    \newtheoremstyle{TheoremNum}
        {\topsep}{\topsep}              %%% space between body and thm
        {\itshape}                      %%% Thm body font
        {}                              %%% Indent amount (empty = no indent)
        {\bfseries}                     %%% Thm head font
        {.}                             %%% Punctuation after thm head
        { }                             %%% Space after thm head
        {\thmname{#1}\thmnote{ \bfseries #3}}%%% Thm head spec
    \theoremstyle{TheoremNum}
    \newtheorem{thmn}{Theorem}


\begin{document}

\begin{thmn}[\ref{T:1}] $1+1 = 2$
\end{thmn}

\begin{thm}\label{T:1} $1+1 = 2$
\end{thm}

\end{document}
share|improve this answer
add comment

A somewhat "sketchy" solution: there's a package by Ulrich Diez called theomac.sty that's floating online but isn't on CTAN, and which I've used once before. The latest version I'm aware of contains the string "2007/06/18 v1.00beta4 Define macros from theorems" in it, and can be found, say, in the discussions here or here (or an older version on Google Groups where you can download it). You use it somewhat as follows:

\usepackage{theomac} %To repeat theorems
\newtheoremWithMacro{rtheorem}[theorem]{Theorem}

...

\begin{rtheorem}[\foo]
  $1 + 1 = 2$ 
\end{rtheorem}

(Or any name instead of rtheorem.) Then you can write \foo anywhere you want the theorem to appear, without having to repeat the body.

share|improve this answer
add comment

Following is how I implement Andrew Stacey's suggestion. The difference is that I use ntheorem to simulate amsthm style; and I'm using \autoref to have a single restatement environment which works for theorems, corollaries, anything - based on just the label. It's not elegant or terse, but it should be useful if you use ntheorem. Of course, if you don't care about AMS styles, just tweak the \newtheoremstyle commands to your liking (while keeping the styles for the statement and the restatement in synch).

Also, the code allows for restatement both with and without additional text after the theorem number.

\documentclass{article}

\usepackage{hyperref}
\usepackage[hyperref]{ntheorem}

\makeatletter
\def\ifempty#1{%
 \def\@tmp@a{#1}%
 \ifx\@tmp@a\@empty%
}

\newtheoremstyle{ams-theorem}%
  {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}%
  {\item[\hskip\labelsep {\theorem@headerfont ##1\ ##2}{\normalfont\ (##3)}{\theorem@headerfont
  \theorem@separator}]}
% The following is a dummy style, we only need it so ntheorem uses its
% unnumbered version properly
\newtheoremstyle{ams-restatedtheorem}
  {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}%
  {\item[\hskip\labelsep {\theorem@headerfont ##1\ ##2}{\normalfont\ (##3)}{\theorem@headerfont
  \theorem@separator}]}
% ... this is the one that's actually used, and in fact, we only use the
% 3-argument variant
\newtheoremstyle{nonumberams-restatedtheorem}%
  {\item[\theorem@headerfont \hskip\labelsep ##1\theorem@separator]}%
  {\item[\hskip\labelsep \theorem@headerfont ##3\theorem@separator]}%

\theoremstyle{ams-theorem}
\theoremheaderfont{\normalfont\bfseries}
\theorembodyfont{\itshape}
\theoremseparator{.}
\theoremindent0cm
\theoremnumbering{arabic}
\theoremsymbol{}

\newtheorem{theorem}{Theorem}
% and here you would have environments such as lemma, corollary, etc.
% (possibly with \newaliascnt commands to get them to use the same
% counter)


\theoremstyle{ams-restatedtheorem}
% the argument of restatedtheorem* shouldn't ever actually be used
\newtheorem*{restatedtheorem*}{}
\newenvironment{restatement}[2][]{%
 \ifempty{#1}
  \begin{restatedtheorem*}[\autoref*{#2}]%
 \else%
  \begin{restatedtheorem*}[\autoref*{#2} (#1)]%
 \fi%
}%
{\end{restatedtheorem*}}
\makeatother

\begin{document}
\begin{theorem}
\label{myfirst}
This is my first theorem.
\end{theorem}
\begin{theorem}
\label{mysecond}
This is my second theorem.
\end{theorem}
\begin{restatement}{myfirst}
This is a restatement of my first theorem.
\end{restatement}
\begin{restatement}[fancy version]{mysecond}
Hear ye, hear ye, the most excellent seconde theoreme!
\end{restatement}
\end{document} 

enter image description here

share|improve this answer
add comment

Finally wanted to do this myself and decided that I didn't like my solution. Here's an alternative. It works for amsthm. Don't know how it would work with other theorem-builders.

\ExplSyntaxOn
\DeclareDocumentEnvironment{repetition}{m o}
{
  \tl_set_eq:Nc \l_tmpa_tl {#1}
  \IfNoValueTF{#2}{
    \tl_set:Nx \l_tmpb_tl {
      \tl_item:Nn \l_tmpa_tl {1}
      {\tl_item:Nn \l_tmpa_tl {2} }
      {}
      {\tl_item:Nn \l_tmpa_tl {4}}
    }
  }
  {
    \tl_set:Nx \l_tmpb_tl {
      \tl_item:Nn \l_tmpa_tl {1}
      {\tl_item:Nn \l_tmpa_tl {2} }
      {}
      {\tl_item:Nn \l_tmpa_tl {4} ~ \exp_not:N \ref{#2} }
    }
  }
  \tl_use:N \l_tmpb_tl
}
{
  \use:c {end #1}
}
\ExplSyntaxOff

This defines a single new environment repetition. The environment takes two arguments, a first mandatory one which is the name of the environment to be repeated, and a second optional one which is the label of the environment to be repeated.

The way it works is as follows. When, say, \begin{proposition} is invoked then eventually the command \proposition is executed. This is a token list consisting of the basic theorem-builder and three arguments which set up how that basic theorem-builder will behave. The first sets the style, so we want to keep that. The second says which counter to use, so we want to throw that away. The third says what the title text should be, so we want to modify that slightly if we're given a label. The L3 stuff does that modification before invoking the token list and thus starting the theorem-builder on its merry way.

share|improve this answer
add comment

Another simple solution that works in simple circumstances:

After the other theorem environments are defined,

\theoremstyle{empty}
\newtheorem{duplicate}{NameIgnored}

Then in the body of the document

\begin{theorem}[My theorem tile]
\label{thm:worth.repeating}
An insightful truth.
\end{theorem}

and elsewhere

\begin{duplicate}[Theorem~\ref{thm:worth.repeating} (My theorem title)]
An insightful truth (again).
\end{duplicate}
share|improve this answer
add comment

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.