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
tcolorboxprovides tools to save boxes for later reuse. This is an example: https://tex.stackexchange.com/a/333613/1952 – Ignasi Feb 19 '19 at 11:58