[Tex/LaTex] Number equation as 0.1 instead of 1

alignbooksequationsnumbering

I am using book class for my thesis. I have a preface which is before the first chapter. In this preface, all sections are numbered like 0.1 etc. However, equations are numbered as 1 instead of 0.1, which looks strange. How can I ask LaTeX to number my equations in preface like 0.1, 0.2, etc, please? Thank you!

Best Answer

As long there is no clear setup: Perhaps this one?

\documentclass{book}


\usepackage{chngcntr}

\begin{document}

\counterwithin{equation}{chapter} % Use chapter as driver for the resetting

\section{A section}

\begin{equation}
  E = mc^2
\end{equation}

\begin{equation}
  c^2 = a^2+b^2
\end{equation}


\chapter{Real stuff}



\section{A section}

\begin{equation}
  E = mc^2
\end{equation}


\end{document}

enter image description here

Related Question