11

I'm writing a final year project and I would like to start it with a "Preliminaries" chapter, whose number I'd like to be 0. I do the trivial \setcounter{chapter}{-1}, which makes the number of the chapter 0, but it also makes all formulae and all figures in the chapter be labeled as (1), (2), ..., instead of (0.1), (0.2), ... How can I fix this?

PS I am not sure which package governs the formulae/figures labeling. I use amsmath, if this matters.

\documentclass[oneside, a4paper, 11pt]{report}
\usepackage{amsmath}

\begin{document}

\setcounter{chapter}{-1}
\chapter{Preliminaries}

Text here...

\begin{equation}\label{eq}
    f = f(x)...
\end{equation}

I would like the label to be (0.1) instead of \eqref{eq}.

\chapter{Next chapter}

Compare the labels:

\begin{equation}
    g = g (x)...
\end{equation}

\end{document}

Output

Newbie
  • 113

1 Answers1

15

Add the following line in your preamble:

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

MWE:

\documentclass[oneside, a4paper, 11pt]{report}
\usepackage{amsmath}

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

\begin{document}

\setcounter{chapter}{-1}
\chapter{Preliminaries}

Text here...

\begin{equation}\label{eq}
    f = f(x)...
\end{equation}

I would like the label to be (0.1) instead of \eqref{eq}.

\chapter{Next chapter}

Compare the labels:

\begin{equation}
    g = g (x)...
\end{equation}

\end{document} 

enter image description here

The original definition in report.cls is

\renewcommand\theequation
  {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation}

which means that the chapter number is printed only when greater than zero.

karlkoeller
  • 124,410