5

I am writing an article with the llncs class, and I am trying to repeat a theorem twice in different sections.

For example,

Section 1

Theorem 1.1. Let ...

And then later in the paper I want to recall the theorem by reprinting it

Section 4

We recall Theorem 1.1:

Theorem 1.1. Let ...

I used the solutions proposed in [1,2,3,4,5], and they seemed to clash and do not work with the llncs class. Is there any way to use these solutions with respect to the llncs class?

[1]-How do I repeat a theorem number?

[2]-Using LaTeX, how can I restate a theorem, with the same theorem number, later in a paper?

[3]-Recalling a theorem

[4]-Repeat a Theorem

[5]- How to automatically repeat all the theorems?

2
  • Welcome to TeX.SX! Can you please explain what your specific problem is? When we know it, perhaps we can suggest which one of the five methods can be made to work or propose a different solution.
    – egreg
    Nov 1, 2016 at 11:37
  • It is the same problem explained in [1,2,3,4,5]. Thanks! Nov 1, 2016 at 11:47

1 Answer 1

5

The llncs class uses a different way of defining theorem-like environments, so it's not a surprise that the other suggested methods don't work. Neither amsthm nor ntheorem based solution can work.

Here I assume the theorem to repeat precedes the repetition. I define a new environment reptheorem that stores the text; it has a mandatory argument that also sets a \label with the same name.

In the example I also show that the optional argument is honored.

\documentclass[envcountsect]{llncs}
\usepackage{environ}

\newcommand{\repeattheorem}[1]{%
  \begingroup
  \renewcommand{\thetheorem}{\ref{#1}}%
  \expandafter\expandafter\expandafter\theorem
  \csname reptheorem@#1\endcsname
  \endtheorem
  \endgroup
}

\NewEnviron{reptheorem}[1]{%
  \global\expandafter\xdef\csname reptheorem@#1\endcsname{%
    \unexpanded\expandafter{\BODY}%
  }%
  \expandafter\theorem\BODY\unskip\label{#1}\endtheorem
}

\begin{document}

\section{Title}

\begin{reptheorem}{foo}[Somebody]
Let $x$ be a foo. Then $x$ is also a baz.
\end{reptheorem}

\section{Another}

\repeattheorem{foo}

\end{document}

enter image description here

A feature asked in comments prompted to write “more modern code” for the job.

\documentclass[envcountsect]{llncs}
\usepackage{amsmath}

\newcommand{\replabel}{\label} % will be redefined in restatements

\ExplSyntaxOn

\NewDocumentCommand{\repeattheorem}{m}
 {
  \group_begin:
  \renewcommand{\thetheorem}{\ref{#1}}
  \renewcommand{\replabel}[1]{\tag{\ref{##1}}}
  \prop_item:Nn \g_reptheorem_prop { #1 }
  \endtheorem
  \group_end:
 }

\NewDocumentEnvironment{reptheorem}{m+b}
 {
  \prop_gput:Nnn \g_reptheorem_prop { #1 } { \theorem #2 \endtheorem }
  \theorem#2\unskip\label{#1}\endtheorem
 }{}

\prop_new:N \g_reptheorem_prop

\ExplSyntaxOff

\begin{document}

\section{Title}

\begin{reptheorem}{foo}[Somebody]
Let $x$ be a foo. Then $x$ is also a baz.
\begin{equation}\replabel{fooeq}
1=1
\end{equation}
with an equation.
\end{reptheorem}

\section{Another}

\repeattheorem{foo}

\end{document}

In theorems to be repeated, labels to equations (mandatory) should be set with \replabel. This way we can change the meaning to use \tag instead. The \label command cannot be used, because amsmath (necessary for \tag) would change back the meaning of \label in a display.

enter image description here

3
  • This is the best solution I've found so far to repeat a theorem in the svjour3 document class. One issue I'm having is that if there is a numbered equation in the original theorem, I'd like the same equation to keep the same number later on. Or, better yet, replace the equation tag (#) with (# revisited) in the repeated theorem. Is there any way to do something like that with your solution?
    – DMcMor
    Apr 15, 2021 at 20:46
  • @DMcMor Not straightforward, but it can be done with some care.
    – egreg
    Apr 15, 2021 at 21:20
  • Your updated solution works perfectly, thanks!
    – DMcMor
    Apr 15, 2021 at 21:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .