0

This question already has an answer here:

For a manuscript I need to include theorem proofs as supplementary material. So I mention the theorem in the main file and I need to re-print the theorem in the supplementary material with the same theorem number and then provide the proof.

For this purpose I define the theorem in the main.tex file as follows:

\begin{restatable}{thm}{firsttheorem}
\label{thm:first}
  Sample theorem. 
\end{restatable}

\begin{proof}
  Refer to supplementary material.
\end{proof}

Then in my supplementary material file supp.tex I use the xr package and refer to my main document as

\usepackage{xr}
\externaldocument{../main}

But I am not able to refer to the theorem as such

\firsttheorem*

It gives the following error message

Undefined control sequence.
\myfirsttheorem

marked as duplicate by Ignasi, Phelype Oleinik, user156344, Raaja, Sebastiano Feb 19 at 13:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.