# Creating duplicate numbering for theorems

A conference I publish at has a strange requirement. In the first X pages (X is not important here), we are required to provide an extended abstract of the work, and then after that, we must attach a complete version of the paper with no page limit (the reason is so that reviewers can read the first X pages, and only peruse the rest if they see fit).

One solution is to prepare the full version, make a PDF, prepare the short version, and then use pdfpages to merge the two pdfs together. This is fine, except that if in the process of creating the short version I decided to remove a lemma, then the lemma numbers are not consistent between the short and long versions.

So my question is this: Is there any way to create the desired "double" version so that lemma numbers are consistent between short and long versions ?

We can assume that the lemmas/theorems in the short version are a subset of those in the long version for simplicity. I should note that "lemma" is a set denoting "lemma, theorem, conjecture, corollary, definition" and so on, so all such numberings should remain consistent.

-
Maybe this question will help: How do I repeat a theorem number? – Alan Munn Jul 16 '11 at 5:30
I looked at that one, and indeed the methods proposed there are useful for a few such instances. But to do this for every lemma/theorem/whatever in a whole document seemed way too much work. I'm hoping for something more elegant :) – Suresh Jul 16 '11 at 5:33
Instinctively I would think one could add an optional command to each numbered environment. The optional argument is meant to take a label (or counter) and set the numbered environment's counter to that of the optional argument. Then use the xr package in order to reference an external document - the long-version of your paper in this case. Consequently feed the long-version's labels to each of the short-version environments. – Werner Jul 16 '11 at 6:17
What a preposterous requirement by the way. – percusse Aug 15 '11 at 17:10

Here is a proposal to solving your problem. The short-version of your article would have the same environments as in the long-version, with an additional optional argument. The optional argument is the long-version label (referenced as an external file via the xr package). This argument is assigned to the short-version environment counter to correct for removal of similar previous environments.

Consider, for example, this is your long-version article (called long-article.tex, say):

\documentclass{article}
\usepackage{lipsum,ntheorem}%
\newtheorem{theorem}{Theorem}% Theorems
\newtheorem{lemma}{Lemma}% Lemmas
\newtheorem{proposition}{Proposition}% Propositions
\begin{document}
\section{Introduction} \lipsum[1]
\begin{theorem} \lipsum[2] \label{thm:first} \end{theorem}
\begin{lemma} \lipsum[3] \label{lem:first} \end{lemma}
\section{Definitions} \lipsum[4]
\begin{theorem} \lipsum[5] \label{thm:second} \end{theorem}
\begin{proposition} \lipsum[6] \label{pro:first} \end{proposition}
\section{Methodology} \lipsum[7]
\begin{theorem} \lipsum[8] \label{thm:third} \end{theorem}
\begin{proposition} \lipsum[9] \label{pro:second} \end{proposition}
\lipsum[10]
\begin{lemma} \lipsum[11] \label{lem:second} \end{lemma}
\section{Conclusions} \lipsum[12]
\begin{theorem} \lipsum[13] \label{thm:fourth} \end{theorem}
\end{document}


Now you create a short-version article (called short-article.tex, say):

\documentclass{article}
\usepackage{lipsum,ntheorem,xr,ifmtarg}

\newtheorem{shorttheorem}{Theorem}% Theorems
\newtheorem{shortlemma}{Lemma}% Lemmas
\newtheorem{shortproposition}{Proposition}% Propositions
\externaldocument[long-]{long-article}% Long-version article

% (SHORT) Theorem definitions
\makeatletter
\newenvironment{theorem}[1][]% Short-version theorems
{\@ifnotmtarg{#1}{%
\setcounter{shorttheorem}{\ref{#1}}%
\begin{shorttheorem}}%
{\end{shorttheorem}}%
\newenvironment{lemma}[1][]% Short-version lemmas
{\@ifnotmtarg{#1}{%
\setcounter{shortlemma}{\ref{#1}}%
\begin{shortlemma}}%
{\end{shortlemma}}%
\newenvironment{proposition}[1][]% Short-version propositions
{\@ifnotmtarg{#1}{%
\setcounter{shortproposition}{\ref{#1}}%
\begin{shortproposition}}%
{\end{shortproposition}}%
\makeatother
\begin{document}
\section{Introduction} \lipsum[1]
\begin{theorem} \lipsum[2] \label{thm:first} \end{theorem}
%\begin{lemma} \lipsum[3] \label{lem:first} \end{lemma}
\section{Definitions} \lipsum[4]
\begin{theorem} \lipsum[5] \label{thm:second} \end{theorem}
\begin{proposition} \lipsum[6] \label{pro:first} \end{proposition}
\section{Methodology} \lipsum[7]
%\begin{theorem} \lipsum[8] \label{thm:third} \end{theorem}
\begin{proposition} \lipsum[9] \label{pro:second} \end{proposition}
\lipsum[10]
\begin{lemma}[long-lem:second] \lipsum[11] \label{lem:second} \end{lemma}
\section{Conclusions} \lipsum[12]
\begin{theorem}[long-thm:fourth] \lipsum[13] \label{thm:fourth} \end{theorem}
\end{document}


You only need to add an optional reference argument to those environments following a removed one ('lemma' and 'theorem' in the above example).

I am not sure why additional (vertical) space was added after executing the \setcounter and \addtocounter commands. However, that's why a negative \baselineskip was added to correct for this behaviour.

-
Nice ! I wonder if there's a way to convert this solution to a package: maybe call it stupid-conference :) – Suresh Aug 15 '11 at 18:43