Take the 2-minute tour ×

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

1 Answer 1

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


