如何在第 1 节中复制第 2、3、4 节中的基于节的自动编号定理?

如何在第 1 节中复制第 2、3、4 节中的基于节的自动编号定理?

我目前通过以下环境变量对第 2、3、4 节等中的定理进行了基于节的自动编号设置:

\numberwithin{equation}{section}
\newtheorem{definition}{Definition}[section]
\newtheorem{theorem}[definition]{Theorem}

现在我想在第 1 节(简介)中复制其中一些定理(带标签)作为主要结果的一部分。

我怎么做?

这是一个最小工作示例。我想要的是将“定理 1.1”更改为“定理 2.1”,将“定理 1.2”更改为“定理 3.1”。

谨致问候 -mike

%--------------------------
\documentclass[a4paper,12pt,reqno,twoside]{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{color}
\usepackage{ifpdf}
\usepackage{array}

\usepackage{url}
\usepackage{graphicx}
\usepackage{float}
\usepackage{multirow,bigdelim}

\addtolength{\textheight}{2cm}
\addtolength{\topmargin}{-1.5cm}
\addtolength{\textwidth}{2cm}
\addtolength{\oddsidemargin}{-1cm}
\addtolength{\evensidemargin}{-1cm}




\numberwithin{equation}{section}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{conjecture}[theorem]{Conjecture}

\usepackage{hyperref}% http://ctan.org/pkg/hyperref
\usepackage{cleveref}% http://ctan.org/pkg/cleveref
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{chngcntr}% http://ctan.org/pkg/lipsum

\newcommand*{\C}{\mathbb{C}}%.............................C
\newcommand*{\R}{\mathbb{R}}%.............................R
\newcommand*{\Q}{\mathbb{Q}}%.............................Q
\newcommand*{\Z}{\mathbb{Z}}%.............................Z
\newcommand*{\N}{\mathbb{N}}%.............................N

\newcommand{\comment}[1]{}

\title[title]%
  {title} 
\author[A. Author]{Author AUTHOR}
%
\date{Version of \today}
%................................
\subjclass[2000]{11M26, 11M50, 11N64 }
\keywords{}
%
\AtBeginDocument{%
%\mathtoolsset{showonlyrefs,mathic = true}
\begin{abstract}

\end{abstract}
\maketitle
%\tableofcontents % Table of Contents
}
%..........................................
\begin{document}
%..........................................
%

\section{Introduction}
\counterwithin{equation}{section}

Here are the major results of this paper:
\begin{theorem}\label{theorem121}
theorem 2.1
\end{theorem}
\begin{theorem}\label{theorem131}
theorem 3.1
\end{theorem}
The proof of these two theorems are given in the subsequent sections.

\section{Implementation, Part I}
\begin{theorem}\label{theorem21}
theorem 2.1
\end{theorem}
\begin{proof}
body of proof of theorem 2.1.
\end{proof}

\begin{theorem}\label{theorem22}
theorem 2.2
\end{theorem}
\begin{proof}
body of proof of theorem 2.2.
\end{proof}

In \cref{theorem21} and \cref{theorem22}, we obtained...

\section{Implementation, Part II}

\begin{theorem}\label{theorem31}
theorem 3.1
\end{theorem}
\begin{proof}
body of proof of theorem 3.1.
\end{proof}

\begin{theorem}\label{theorem32}
theorem 3.2
\end{theorem}
\begin{proof}
body of proof of theorem 3.2.
\end{proof}


In \cref{theorem31} and \cref{theorem32} we obtained...
%---------------------------------------
\end{document}

答案1

您可以覆盖\thetheorem生成定理编号的命令。例如,您可以在简介中执行以下操作:

\renewcommand{\thetheorem}{2.1}
\begin{theorem}\label{theorem121}
theorem 2.1
\end{theorem}
\renewcommand{\thetheorem}{3.1}
\begin{theorem}\label{theorem131}
theorem 3.1
\end{theorem}

但是,由于您现在已经替换了增加定理编号的实际逻辑,因此其余定理的编号将不正确。因此,您需要首先备份 LaTeX 定理编号的原始逻辑:

\let\thetheoremdefault\thetheorem

并在介绍部分之后恢复它:

\let\thetheorem\thetheoremdefault

这是更新后的工作示例:

\documentclass[a4paper,12pt,reqno,twoside]{amsart}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{color}
\usepackage{ifpdf}
\usepackage{array}

\usepackage{url}
\usepackage{graphicx}
\usepackage{float}
\usepackage{multirow,bigdelim}

\addtolength{\textheight}{2cm}
\addtolength{\topmargin}{-1.5cm}
\addtolength{\textwidth}{2cm}
\addtolength{\oddsidemargin}{-1cm}
\addtolength{\evensidemargin}{-1cm}

\numberwithin{equation}{section}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{conjecture}[theorem]{Conjecture}

% Backup the original theorem-numbering logic
\let\thetheoremdefault\thetheorem

\usepackage{hyperref}% http://ctan.org/pkg/hyperref
\usepackage{cleveref}% http://ctan.org/pkg/cleveref
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{chngcntr}% http://ctan.org/pkg/lipsum

\newcommand*{\C}{\mathbb{C}}%.............................C
\newcommand*{\R}{\mathbb{R}}%.............................R
\newcommand*{\Q}{\mathbb{Q}}%.............................Q
\newcommand*{\Z}{\mathbb{Z}}%.............................Z
\newcommand*{\N}{\mathbb{N}}%.............................N

\newcommand{\comment}[1]{}

\title[title]%
  {title} 
\author[A. Author]{Author AUTHOR}
%
\date{Version of \today}
%................................
\subjclass[2000]{11M26, 11M50, 11N64 }
\keywords{}
%
\AtBeginDocument{%
%\mathtoolsset{showonlyrefs,mathic = true}
\begin{abstract}

\end{abstract}
\maketitle
%\tableofcontents % Table of Contents
}
%..........................................
\begin{document}
%..........................................
%

\section{Introduction}
\counterwithin{equation}{section}

Here are the major results of this paper:
\renewcommand{\thetheorem}{2.1}
\begin{theorem}\label{theorem121}
theorem 2.1
\end{theorem}
\renewcommand{\thetheorem}{3.1}
\begin{theorem}\label{theorem131}
theorem 3.1
\end{theorem}
The proof of these two theorems are given in the subsequent sections.

% Restore the original theorem-numbering logic
\let\thetheorem\thetheoremdefault

\section{Implementation, Part I}
\begin{theorem}\label{theorem21}
theorem 2.1
\end{theorem}
\begin{proof}
body of proof of theorem 2.1.
\end{proof}

\begin{theorem}\label{theorem22}
theorem 2.2
\end{theorem}
\begin{proof}
body of proof of theorem 2.2.
\end{proof}

In \cref{theorem21} and \cref{theorem22}, we obtained...

\section{Implementation, Part II}

\begin{theorem}\label{theorem31}
theorem 3.1
\end{theorem}
\begin{proof}
body of proof of theorem 3.1.
\end{proof}

\begin{theorem}\label{theorem32}
theorem 3.2
\end{theorem}
\begin{proof}
body of proof of theorem 3.2.
\end{proof}


In \cref{theorem31} and \cref{theorem32} we obtained...
%---------------------------------------
\end{document}

答案2

还有其他重复语句的方法。可以按照以下方法手工重复几个语句。

这个想法是有一个未编号的定理类型,它接收正确的标题作为环境的参数reptheorem

强制参数是分配给主体部分中的语句的标签。不支持标记重复定理,而且这样做没有意义。通过使用,我们确保重复定理中的数字在加载\Cref时是链接。hyperref

\documentclass[a4paper,12pt,reqno,twoside]{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{color}
\usepackage{ifpdf}
\usepackage{array}

\usepackage{url}
\usepackage{graphicx}
\usepackage{float}
\usepackage{multirow,bigdelim}

\usepackage{hyperref}% http://ctan.org/pkg/hyperref
\usepackage{cleveref}% http://ctan.org/pkg/cleveref
%\usepackage{lipsum}% http://ctan.org/pkg/lipsum
%\usepackage{chngcntr}% Not needed with recent versions of LaTeX

\addtolength{\textheight}{2cm}
%\addtolength{\topmargin}{-1.5cm}    % <--- NO
\addtolength{\textwidth}{2cm}
%\addtolength{\oddsidemargin}{-1cm}  % <--- NO
%\addtolength{\evensidemargin}{-1cm} % <--- NO
\calclayout % <--- YES

\numberwithin{equation}{section}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{conjecture}[theorem]{Conjecture}

\newcommand{\reptheoremname}{}
\newtheorem*{reptheoreminner}{\reptheoremname}
\newenvironment{reptheorem}[1]
 {\renewcommand{\reptheoremname}{\cref{#1}}\reptheoreminner}
 {\endreptheoreminner}


\newcommand*{\C}{\mathbb{C}}%.............................C
\newcommand*{\R}{\mathbb{R}}%.............................R
\newcommand*{\Q}{\mathbb{Q}}%.............................Q
\newcommand*{\Z}{\mathbb{Z}}%.............................Z
\newcommand*{\N}{\mathbb{N}}%.............................N

\newcommand{\comment}[1]{}

\title[title]%
  {title} 
\author[A. Author]{Author AUTHOR}
%
\date{Version of \today}
%................................
\subjclass[2000]{11M26, 11M50, 11N64 }
\keywords{}
%
\AtBeginDocument{%
%\mathtoolsset{showonlyrefs,mathic = true}
\begin{abstract}

\end{abstract}
\maketitle
%\tableofcontents % Table of Contents
}
%..........................................
\begin{document}
%..........................................
%

\section{Introduction}
\counterwithin{equation}{section}

Here are the major results of this paper:
\begin{reptheorem}{theorem21}
theorem 2.1
\end{reptheorem}
\begin{reptheorem}{theorem31}
theorem 3.1
\end{reptheorem}
The proof of these two theorems are given in the subsequent sections.

\section{Implementation, Part I}
\begin{theorem}\label{theorem21}
theorem 2.1
\end{theorem}
\begin{proof}
body of proof of theorem 2.1.
\end{proof}

\begin{theorem}\label{theorem22}
theorem 2.2
\end{theorem}
\begin{proof}
body of proof of theorem 2.2.
\end{proof}

In \cref{theorem21} and \cref{theorem22}, we obtained...

\section{Implementation, Part II}

\begin{theorem}\label{theorem31}
theorem 3.1
\end{theorem}
\begin{proof}
body of proof of theorem 3.1.
\end{proof}

\begin{theorem}\label{theorem32}
theorem 3.2
\end{theorem}
\begin{proof}
body of proof of theorem 3.2.
\end{proof}


In \cref{theorem31} and \cref{theorem32} we obtained...
%---------------------------------------
\end{document}

我对您的文档序言做了一些调整;避免设置\oddsidemargin\evensidemargin并更喜欢amsart特定的\calclayout命令。

此外,最好避免混合设置和包加载。

在此处输入图片描述

相关内容