如何停止 LaTex 编号部分内的方程式

如何停止 LaTex 编号部分内的方程式
\documentclass[]{phstyle}
\usepackage{latexsym,amsfonts,amssymb, undertilde}
\usepackage[fleqn]{amsmath}
\usepackage{makeidx}

%Preamble

\numberwithin{equation}{chapter}
%\renewcommand{\theequation}{\thesection.\arabic{equation}}

\begin{document}

%\include{chapI}   these 2 lines are because the chapters are different tex files

%\include{chap1}

\renewcommand{\thechapter}{\Roman{chapter}}

%\setcounter{chapter}{0}
%\renewcommand{\theequation}{\thechapter.\arabic{equation}}

\chapter{Introduction}

\section{Chap I Section1}

\begin{equation}
this is equation I.1
\end{equation}

\begin{equation}
this is equation I.2
\end{equation}

\section{Chap I Section2}

\begin{equation}
this is equation I.3
\end{equation}

\chapter{Chapter 1}

\section{Chap 1 Section 1}

\begin{equation}
this is equation 1.1.1
\end{equation}

\begin{equation}
this is equation 1.1.2
\end{equation}

\end{document}

我一直在输入包含章节、小节和方程式的第 1-5 章。方程式是全局编号的,即,如果我在第 1 章的第 1 节中有 3 个方程式,则它们的编号为 1.1.1、1.1.2、1.1.3,而对于第 2 节,方程式的编号为 1.2.4、1.2.5 等。最近我不得不将第 1 章及其中的所有内容更改为第 I 章(罗马数字),并将第 2 章重新编号为第 1 章,等等。

我的问题是,LaTeX 开始根据章节对第一章中的方程式进行编号(其他章节没有这个问题),而不是全局编号。也就是说,第一章中的 3 个方程式分别是 I.1、I.2、I.3,而第一章第二节中的方程式变成了 I.1、I.2 等,而不是 I.4、I.5 等

我需要前缀是章节而不是节。我不明白为什么要改变。我从未\numberwithin在我的书中使用过

以下是我的一些代码

\documentclass[]{phstyle}
\usepackage{latexsym,amsfonts,amssymb, undertilde}
\usepackage[fleqn]{amsmath}

第一章中的方程编号

\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\theequation}{\thechapter.\arabic{equation}} **

以前,当第 1 章为第 1 章时,** 为

\renewcommand{\theequation}{\thesection.\arabic{equation}}

我也尝试过下面的方法,但没有效果

\renewcommand{\theequation}{I.\arabic{equation}}

先感谢您

答案1

你所描述的问题似乎是由于phstyle 类包括说明

\def\theequation{\thesection.\arabic{equation}}
\@addtoreset{equation}{section}

要覆盖此行为并按章节对方程式进行编号,请在序言中插入以下说明:

\usepackage{chngcntr}
\counterwithout{equation}{section} % undo numbering system provided by phstyle.cls
\counterwithin{equation}{chapter}  % implement desired numbering system

相关内容