\usepackage{latexsym,amsfonts,amssymb, undertilde}




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





\section{Chap I Section1}

this is equation I.1

this is equation I.2

\section{Chap I Section2}

this is equation I.3

\chapter{Chapter 1}

\section{Chap 1 Section 1}

this is equation 1.1.1

this is equation 1.1.2


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

\usepackage{latexsym,amsfonts,amssymb, undertilde}

for the equation numbering in Chap I

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

Previously when Chap I was Chap 1, ** was


I have also tried the line below but it didn't work


Thank you in advance

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – karlkoeller Sep 13 '13 at 13:37
  • 2
    Instead of operating directly on \theequation, you could issue the command \numberwithin{equation}{chapter} in the preamble of your document, after the amsmath package has been loaded. (The amsmath package provides the command \numberwithin.) – Mico Sep 13 '13 at 13:45
  • 1
    Also, perhaps this is your document class. – Ian Thompson Sep 13 '13 at 15:07
  • Your MWE works fine if I substitute phstyle with report. There must be a problem with the document class. – karlkoeller Sep 13 '13 at 15:58

The problem you're describing seems to be caused by the fact that the phstyle class includes the instructions


To override this behavior and have the equations numbered by chapter instead, insert the following instructions in the preamble:

\counterwithout{equation}{section} % undo numbering system provided by phstyle.cls
\counterwithin{equation}{chapter}  % implement desired numbering system
| improve this answer | |
  • What a lifesaver! Thanks Mico! I clicked the check sign before I read about the vote up and vote down buttons. Now when I try to vote up, it tells me it needs 15 reputations before it can get upvoted. My upvote didn't get registered. Sorry Mico. – Anne Sep 14 '13 at 1:10
  • sorry to once not comply with the comment standards, but you Sir, are awesome. – qrtLs May 30 '16 at 12:01
  • 1
    @ItsmeJulian - You're most welcome! :-) – Mico May 30 '16 at 14:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.