Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  karlkoeller Mar 22 at 11:36

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer
    
Thank you for the fast reply. –  Newbie Mar 22 at 11:39
    
I'd prefer the easier \renewcommand{\theequation}{\thechapter.\arabic{equation}} –  egreg Mar 22 at 11:39
    
@egreg You're right. No need for low-level commands. –  karlkoeller Mar 22 at 11:40
    
@Newbie You're welcome. Remember that you can accept (and upvote) the answer, if you want. See How do you accept an answer? –  karlkoeller Mar 22 at 11:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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