I am writing a book in LaTeX in which I label problems m.n for Chapter m, problem n (for example, problem 6.10 is the 10th problem in Chapter 6). I am using the declaration


and this correctly prints problem labels in the enumerate environment where the problems are listed. However, when I refer to a problem elsewhere, it only prints the problem number (e.g., "see Problem 6.10" is written "see Problem 10"). Is there a global fix for this?


As Christian suggests, using the enumitem package is probably the best approach. I would go one step further than the answer he refers to and define a new problems environment for your problems. To do what you want using enumitem is as simple as:

\newlist{problems}{enumerate}{1}% or 2 or 3 if you want to nest
                   ref=Problem \thechapter.\arabic*

Here I am assuming that you want \ref{...} to print something like Problem 1.2. If you just want it to print 1.2 then omit the ref=.... For more details consult the very readable enumitem manual.

In fact, as shown below, I would also have the problems environment automatically add a heading for the problems, which you can do using the before= option from. enumitem. Below I have used \section{...} but perhaps \section*{...} or \subsection{...} etc would work better for you.

Here a full minimal working example:


\newlist{problems}{enumerate}{1}% or 2 or 3 if you want to nest
                   ref=Problem \thechapter.\arabic*,
                   before={\section{Problems for Chapter \thechapter}}


\chapter{First chapter}

  \item Is the Riemann hypothesis true? \label{Riemann}
  \item Find the first counter-example to the twin primes conjecture

Actually, \ref{Riemann} and \ref{twins} are quite hard, so allow at
least an extra week.

For completeness, this produces:

enter image description here


Referencing counters uses \the<cntr> as it's reference content. So, instead, you should redefine \theenumi to fully contain your representation (as it will be set and therefore referenced):

enter image description here




\setcounter{chapter}{9}% Just for this example


See questions \ref{q:first}--\ref{q:last}.

  \item \label{q:first}
  First question

  Second question

  Third question

  \item \label{q:last}
  Last question


The above example redefines \theenumi as part of a new questions environment. This allows you to localise the change of definition without it affecting other enumerate environments (if they're used).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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