I'm creating a Beamer presentation based on the content of another tex file (a report). To avoid copy-pasting and allow automatic updating of the content, I would like to simply call the specific theorem I want from the original file and restate it where I need it in the Beamer presentation. Since I want to add some additional explanations and examples between each theorem, I need to be able to import them one by one. Also, I need the numbering of the theorems to be the same in both documents, since the presentation only covers a part of the report, for example only a chapter.
Here are some solutions to similar problems that I have found but do not meet all my requirements (I include them in case they are of some help to find a solution or to understand my problem better):
- The problem with this solution is that I think it is only for theorems included in the same pdf/document: https://tex.stackexchange.com/questions/51286/recalling-a-theorem
- The trouble with the next one is that it doesn't allow me to import theorems one by one. Also I would prefer not use boxes or invisible boxes. In addition, it is not possible in my case to add the additional content at the end of each theorem and make it visible only when I restate them (since that can arise problems due to the fact that the destination file is a presentation): https://tex.stackexchange.com/questions/333596/restate-theorem-in-separate-file
The following files are the ones of the original report:
- file with the theorems (theorems.tex):
\chapter{Chapter title}
\section{Section 1}
\begin{thm}\label{thm-1}
Theorem 1 of section 1
\end{thm}
\begin{thm}\label{thm-2}
Theorem 2 of section 1
\end{thm}
\section{Section 2}
\begin{thm}\label{thm-3}
Theorem 1 of section 2
\end{thm}
\begin{thm}\label{thm-4}
Theorem 2 of section 2
\end{thm}
- main file of the report:
\documentclass{report}
\newtheorem{thm}{Theorem}[section]
\begin{document}
\input{theorems}
\end{document}
What I am doing right now to create my presentation is the following:
\documentclass{beamer}
\newtheorem{thm}{Theorem}[section]
\setbeamertemplate{theorems}[numbered]
\begin{document}
\section{Section 1}
\begin{frame}
\begin{thm}
Theorem 1 of section 1
\end{thm}
Additional content
\begin{thm}
Theorem 2 of section 1
\end{thm}
Additional content
\end{frame}
\section{Section 2}
\begin{frame}
\begin{thm}
Theorem 1 of section 2
\end{thm}
\begin{thm}
Theorem 2 of section 2
\end{thm}
Additional content
\end{frame}
\end{document}
As you can see, with my current solution, I'm missing the chapter numbering reference. What I would like is to find or define a command similar to \fullref{tex-file}{thm-label}
so that I can get the same result but with some code similar to this:
\documentclass{beamer}
%\newtheorem{thm}{Theorem}[section]
%\setbeamertemplate{theorems}[numbered]
\begin{document}
\section{Section 1}
\begin{frame}
\fullref{theorems.tex}{thm-1}
Additional content
\fullref{theorems.tex}{thm-2}
Additional content
\end{frame}
\section{Section 2}
\begin{frame}
\fullref{theorems.tex}{thm-3}
\fullref{theorems.tex}{thm-4}
Additional content
\end{frame}
\end{document}