I am preparing a two part document (two separate TEX files, two separate PDF files), where the second part is a continutation of the first part. As such, numbering of Theorems, Lemmas etc. are resumed from first document. Can anyone suggest how to read the last Theorem number from document 1, add 1 to it, and start numbering Theorems in document 2 from that number?
MWEs (copied):
doc1.tex
\documentclass{article}
\usepackage[english]{babel}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
Let $f$ be a function whose derivative exists in every point, then $f$ is a continuous function.
\end{theorem}
\end{document}
doc2.tex
\documentclass{article}
\usepackage[english]{babel}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
New theorem, with theorem number 2
\end{theorem}
\end{document}
xr
package – Andrew Swann Sep 27 '18 at 16:17