Create a beamer presentation by restating theorems of another tex file

2.5k views Asked by At

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 following files are the ones of the original report:

  1. 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}
  1. main file of the report:
\documentclass{report}

\newtheorem{thm}{Theorem}[section]

\begin{document}
    \input{theorems}
\end{document}

enter image description here

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}

enter image description here

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}
0

There are 0 answers