TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the exercise package together with memoir class. How do I number my exercises according to chapter number, in the same way that display equations are numbered? Here's a minimal example



        Lorem ipsum dolor sit amet
            This should come out as Exercise 1.1
            Answer 1.1

            This should be Exercise 1.2

        Consectetuer adipiscing elit
            And this should be Exercise 2.1

            Certainly this should be Exercise 2.2
            Answer 2.2

I'm thinking of tapping into a counter variable in memoir or somewhere else. How do I go about it? I would like the numbering to also affect the Answer environment.

share|improve this question
up vote 8 down vote accepted

I guess that


should do what you need. The chngcntr package is used for binding a counter to another or to free one from another (with \counterwithout).

share|improve this answer

The exercise package provides the Exercise counter. Therefore, if you want the exercises numbered according to the chapter counter, you need:

\renewcounter{Exercise}[chapter]% Reset counter every chapter

Exercise & answer

For any future reference on counters (how to reset them, so-called "master and slave" countering), consider reading the following UK TeX FAQ entries:

share|improve this answer
To help with future applications, what reference manual can I look up usage of \thechapter? (I found \arabic in vim-LaTeX Suite :help arabic) – Kit Sep 4 '11 at 14:48
@Kit: I've added 2 references to my answer. – Werner Sep 4 '11 at 14:54

If you're willing or happy to use the amsmath package, you could also set

share|improve this answer

Your Answer


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.