2

我正在根据另一个 tex 文件(报告)的内容创建一个 Beamer 演示文稿。为了避免复制粘贴并允许自动更新内容,我想简单地从原始文件中调用我想要的特定定理,并在 Beamer 演示文稿中我需要的地方重新声明它。由于我想在每个定理之间添加一些额外的解释和示例,因此我需要能够将它们一一导入。此外,我需要两个文档中的定理编号相同,因为演示文稿仅涵盖报告的一部分,例如仅一章。

以下是我发现但不满足我所有要求的类似问题的一些解决方案(我将它们包括在内,以防它们有助于找到解决方案或更好地理解我的问题):

以下文件是原始报告的文件:

  1. 带有定理 ( 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. 报告主要文件:
\documentclass{report}

\newtheorem{thm}{Theorem}[section]

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

在此处输入图像描述

我现在正在做的创建我的演示文稿如下:

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

在此处输入图像描述

如您所见,使用我当前的解决方案,我缺少章节编号参考。我想要的是找到或定义一个类似的命令,\fullref{tex-file}{thm-label}这样我就可以获得相同的结果,但代码类似于:

\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}
4

0 回答 0