This question is a development of the same issue as this one; following my own answer and later comment there, I decided it deserves a spin-off.
I would like to define an environment for restating theorems(/lemmata/propositions/etc), which makes the following code work:
\documentclass{article}
\usepackage{ntheorem}
% Magic goes here
\newtheorem{theorem}{Theorem}[section]
\newtheorem{prop}[theorem]{Proposition}
\begin{document}
\begin{theorem}\label{myfirst}
This is the first environment.
\end{theorem}
\begin{prop}\label{mysecond}
This is the second environment.
\end{prop}
\begin{theorem}\label{mythird}
This is the third environment.
\end{theorem}
\clearpage
\begin{restatement}[restated]{mysecond}
\label{mysecond-restated}
This is a restatement of the second environment.
\end{restatement}
\begin{theorem}\label{myfourth}
This is the fourth environment.
\end{theorem}
a \verb|ref| to the second environment: \ref{mysecond} \
a \verb|ref| to its restatement: \ref{mysecond-restated} \
a \verb|pageref| to the second environment: \pageref{mysecond} \
a \verb|pageref| to its restatement: \pageref{mysecond-restated}
\end{document}
Requirements:
- The environment only requires the label of the theorem you're referencing, nothing else.
- You should be able to reference the restatement rather than the original statement.
- You can't assume the environment's counter has the same name as the environment (e.g. the user may have
\newtheorem{proposition}[theorem]{Proposition}, so propositions use the theorem counter).
Optional, Nice-to-Have features:
- No reliance on
hyperref,clevereforthmtools. (This was "Requirement 5" which the bounty mentions) - Code which works with
amsthmas well. \autorefing or\namecrefing the restatement work whenhyperreforcleverefare used.- Code doesn't break when writing right-to-left documents (Hebrew, Arabic)
- Possibility of restating unnumbered theorems.
An initial solution
My initial work has evolved into a basically-satisfactory solution, see below, with the help I got asking lead-up questions. But that solution suffers from several problems:
The problems with this are:
- I have no idea what
\cref@constructprefixinntheoremdoes, and what's the intended use ofp@somecounter, so I basically copy-pasted that part blindly and maybe I'm doing something wrong. - The code is already not so short.
- Code likely to break if
clevereforntheoremchange slightly.
And it does not meet most of the useful want-to-have's above. So improvements are quite welcome for your bounty!
cleverefand some other packages. – egreg Dec 22 '11 at 15:20\begin{prop}[continues=mysecond]in thmtools, which would by default give "Proposition 2 (continuing from p. 1)". – Ulrich Schwarz Dec 27 '11 at 14:09