4

As you may well know, the book class follows the structure bellow for numbering equations:

Chapter 1
First Equation 1.1
Second Equation 1.2
Chapter 2
First Equation 2.1
Second Equation 2.2
Third Equation 2.3

This numbering system is irrespective of the section at which the equation is placed. I want the custom numbering format described bellow:

Chapter 1
Section 1
First Equation 1.1
Second Equation 1.2
Section 2
First Equation 2.1
Second Equation 2.2
Chapter 2
Section 1
First Equation 1.1
Second Equation 1.2
Third Equation 1.3
Section 2
First equation 2.1
Second Equation 2.2

As you can see the chapter number is not shown in the equation tag, but the equations numbers are reset as a new chapter is introduced. In addition, the equations are counted within each section.

Please tell me how to perform this action in LaTeX?

  • 1
    Try to add in your document preambe \renewcommand{\theequation}{\thesection.\arabic{equation}} and see, if the numbering is such as you wish to be. – Zarko Aug 11 '15 at 20:39
2

You can use the chngcntr package:

\documentclass{book}

\usepackage{chngcntr}
\counterwithin*{equation}{section}
\renewcommand{\theequation}{\arabic{section}.\arabic{equation}}

\begin{document}

\mainmatter

\chapter{First chapter}

\section{First section}

Text
\begin{equation}
\mbox{First equation}
\end{equation}
text
\begin{equation}
\mbox{Second equation}
\end{equation}

\section{Second section}

Text
\begin{equation}
\mbox{First equation}
\end{equation}
text
\begin{equation}
\mbox{Second equation}
\end{equation}

\chapter{Second chapter}

\section{First section}

Text
\begin{equation}
\mbox{First equation}
\end{equation}
text
\begin{equation}
\mbox{Second equation}
\end{equation}

\section{Second section}

Text
\begin{equation}
\mbox{First equation}
\end{equation}
text
\begin{equation}
\mbox{Second equation}
\end{equation}

\end{document}

enter image description here

  • Great, this works just fine. One more thing... I'm using "xepersian" package, supporting Persian language--an RTL language. Instead of showing a dot, between the section number, and the equation number, in the renewed command it shows a comma! I tried other characters, and they work just fine; the problem is with the dot. How to get the dot into the numbering? To make further clarification, for example the fourth equation in third section is shown as: 3,4 not 3.4 – user84620 Aug 12 '15 at 4:36
  • @RezaSoleymanifar This requires a new question with a full compilable example. – egreg Aug 12 '15 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy