报告中某一章第零节定理编号错误

报告中某一章第零节定理编号错误

我正在写一份多章节的报告,但在新章节零部分的定理编号是否正确方面遇到了问题。

例如,第二章以推论 2.3.21 结束,第三章以定理 3.0.22 开始。同样,第三章以推论 3.3.2 结束,第四章以定理 4.0.3 开始。等等……

我的(经过编辑,没有写出整个定理)代码如下。

\documentclass[12pt]{report} 
\usepackage{fullpage}
\usepackage{amsmath} 
\usepackage{amsthm} 
\usepackage{amssymb}
\usepackage{MnSymbol} 
\usepackage[shortlabels]{enumitem}
\usepackage[all,arc,curve,color,frame]{xy}
\usepackage[pdftex]{graphicx}

%Declaring a bunch of math symbols%
\newtheorem{theorem}{Theorem}[section]
\newtheorem{remark}[theorem]{Remark}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{example}[theorem]{Example}
\newtheorem*{theorem*}{Theorem}
\newtheorem*{corollary*}{Corollary}

\begin{document}

\chapter{The First Chapter} \input{thefirstchapter}

\chapter{The Second Chapter} \input{thesecondchapter}

et cetera

编辑:我还忘了提及一些非常奇怪的事情:第一章和第二章都很好,但接下来的每一章都有问题。

编辑第 2 部分:这是一个最小的工作示例

\documentclass[12pt]{report}
\usepackage{fullpage}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{remark}[theorem]{Remark}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{lemma}[theorem]{Lemma}
\begin{document}
\chapter{The First Chapter}
\begin{theorem} Here's some stuff.\end{theorem}
\begin{remark} Here's a remark about stuff \end{remark}
\section{stuff part 2}
\begin{corollary} Here's some stuff about stuff\end{corollary}
\begin{conjecture} Here's what should happen \end{conjecture}
\chapter{The Second Chapter}
\begin{lemma} Here's some small stuff\end{lemma}
\begin{lemma} Here's some more smalll stuff\end{lemma}
\section{big stuff}
\begin{theorem} Big Theorem\end{theorem}
\begin{theorem} Big Theorem\end{theorem}
\begin{corollary} Big Consequence.\end{corollary}
\section{almost as big stuff}
\begin{lemma} small stuff\end{lemma}
\begin{theorem} big stuff\end{theorem}
\begin{corollary} big stuff\end{corollary}
\chapter{The Third chapter}
\begin{definition} How about this stuff?\end{definition}
\end{document}

请注意,第 2 章的第一个引理打印为引理 2.0.3,第 3 章中的定义打印为定义 3.0.4

答案1

您正在对章节内的定理进行编号。因此,如果定理在第一个命令之前出现在章节的第一部分中\section,则定理编号将不会被重置。(由于您已指定每个章节的编号,因此它不会在章节中断时自动重置。)

在任何章节的开头添加代码\setcounter{theorem}{0},在第一节之前您将有定理类对象。

@lockstep 的评论中给出了参考还包含一个可行的方法。

相关内容