3

I would like to reset the counters for everything, figures, tables, algorithms, lemmas, definitions, equations and others. So that they start at one again, for every chapter. Is it possible or do I have to do it separately for each?

PS: I use \documentclass[11pt]{book}.

6
  • 3
    Welcome to TEX.SE! This should be default if you are using e.g. the book class. If you are using something else or have defined counters on your own, plase provide a full minimal working example which reproduces the issue.
    – campa
    Commented Oct 13, 2016 at 12:21
  • Which document class do you use?
    – Mico
    Commented Oct 13, 2016 at 12:21
  • in most classes that is the default Commented Oct 13, 2016 at 12:21
  • \documentclass[11pt]{book}
    – Johan
    Commented Oct 13, 2016 at 12:25
  • 1
    different classes have different requirements, especially those classes provided by publishers. so no, it is not possible to reset all counters for all classes at once, nor would it be a good idea. Commented Oct 13, 2016 at 12:42

1 Answer 1

4

Basically you need to do it for each. The numbering system is based on counters, and each number has its own counter. Resetting all counters would include things you don't want to reset, like page numbers. As said in the comments, different document classes treat the counters different. In book for example, things like section, subsection, equation, table and figure are automatically reset at each chapters start. But for example theorem and lemma, and other things you define by your self, you need define it such that it the counter reset at chapter start. For example:

\documentclass{book}
\usepackage{graphicx}
\newtheorem{theorem}{Theorem}[chapter] %%% Reset theorem counter at chapter start
\begin{document}

\chapter{First chapter}
\section{First section}
\begin{theorem}
  As can be see in Figure~\ref{fig:Test1}...
\end{theorem}
\begin{figure}[htb]
  \centering
  \includegraphics[width=0.3\linewidth]{example-image-a}
  \caption{Test figure.}
  \label{fig:Test1}
\end{figure}

\section{Second section}
\begin{theorem}
  Test
\end{theorem}

\chapter{Second chapter}
\section{First section}
\begin{theorem}
  Euler's identity
  \begin{equation}
    e^{i\pi}+1=0
  \end{equation}
\end{theorem}
\begin{figure}[htb]
  \centering
  \includegraphics[width=0.3\linewidth]{example-image-a}
  \caption{Test figure.}
  \label{fig:Test2}
\end{figure}

\section{Second section}
\begin{theorem}
  Test
\end{theorem}

\end{document}

First chapter: enter image description here

Second chapter: enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .