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 exercise.sty and have two Exercise counters I'm trying to use, one for Examples with in a chapter, and one for Problems for the chapter. Here's an example:


\begin{Exercise}[ title={#1}, label={#2} ]%

\begin{Exercise}[ title={#1}, label={#2}, name={Example}, counter={Example} ]%



   Given $b=e$, compute $foo(b)$...

   Given $b=f$, compute $foo(b)$...

   \makeproblem{compute foo}{ch1:problem:foo}{
   Given $b=a$, compute $foo(b)$.

   \makeproblem{compute bar}{ch1:problem:bar}{
   Given $b=a$, compute $bar(b)$.


However, in the output:

with basic formatting

notice how the counters for the Examples are not shown incrementing (even within one chapter).

EDIT: noticed only after the fact that my example without any change to the formatting also didn't show incrementing Example numbers. Deleted all parts of the question about my formatting modifications.

EDIT2: This issue appears to be due to a mis-interaction of the chngcntr package with the exercise package once a non-default counter is used. Is there any way to deal with this?

share|improve this question
up vote 4 down vote accepted

You could use \renewcounter, provided by the same package, and redefine \theExercise:


Internally, the package uses \@ExerciseCounter (initialized with Exercise) with \theExercise, that's why just redefining \theExample doesn't work.

share|improve this answer
Thanks. It wasn't clear to me from the documentation how to use that renewcounter command (written for a much more sofisticated latex user than myself). I'd tried, but must have had the syntax wrong. – Peeter Joot May 22 '12 at 17:44

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.