\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}
I have been typing Chapters 1-5 that contain sections and subsections and equations. The equations were numbered globally, i.e. if I had 3 equations in section 1 of Chap 1, they were numbered 1.1.1, 1.1.2, 1.1.3 and for Section 2, the equations were 1.2.4, 1.2.5, etc. Recently I had to change Chap 1 and everything in it to Chapter I (roman number) and Chap 2 were renumbered to Chap 1, etc.
My problem is that LaTeX started numbering the equations in Chap I (the other chapters did not have this problem) according to the sections and not globally anymore. That is, the 3 equations in Chap I were I.1, I.2, I.3, and the equations in the second section of Chap I became I.1, I.2, etc instead of I.4, I.5, etc
I needed the prefix to be the chapter and not the sections.
I don't understand why there is a change. I have never used \numberwithin in my book
Here are some of my codes
\documentclass[]{phstyle}
\usepackage{latexsym,amsfonts,amssymb, undertilde}
\usepackage[fleqn]{amsmath}
for the equation numbering in Chap I
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\theequation}{\thechapter.\arabic{equation}} **
Previously when Chap I was Chap 1, ** was
\renewcommand{\theequation}{\thesection.\arabic{equation}}
I have also tried the line below but it didn't work
\renewcommand{\theequation}{I.\arabic{equation}}
Thank you in advance
\theequation, you could issue the command\numberwithin{equation}{chapter}in the preamble of your document, after theamsmathpackage has been loaded. (Theamsmathpackage provides the command\numberwithin.) – Mico Sep 13 '13 at 13:45phstylewithreport. There must be a problem with the document class. – karlkoeller Sep 13 '13 at 15:58