I have created a customized list environment in the book class. The labels for the list are produced the way I want, but when items are referenced, they are not labeled correctly. Here is the code. Does anyone know how to solve this problem?


\renewcommand{\theenumi} {\arabic{enumi}}
\renewcommand{\theenumii} {\alph{enumii}}

\vspace{1cm}\begin{center}{\scshape\large Nonsense}\end{center}\vspace{2pt}\noindent




\chapter{Chapter 1}
\mynonsense % command which produces header
\item \label{1} item 1-1
\item \label{2} item 1-2
\item \label{2a1} item 1-2.1
\item \label{2a2} item 1-2.2
\item \label{3} item 1-3
\item \label{a} item 1-3a
\item \label{b} item 1-3b
Labels print out as \ref{1}, \ref{2}, \ref{2a1}, \ref{2a2}, \ref{3}, \ref{a},
\ref   {b},  which  is wrong.  Correct is (1-1), (1-2), (1-2.1), (1-2.2) (1-3),
(1-3a), (1-3b).
  • 1
    Welcome to TeX.SX! Did you have a look at the enumitem package that's more powerful than paralist? – egreg Nov 25 '13 at 23:10

\labelenumi and similars only change how the label is presented. In order to change the actual representation of the counter (which is referenced by the \label and \ref commands), you need to replace your \labelenumi and \labelenumii with \theenumi and \theenumii respectively in your custom environment.

Just changing those right after the \begin{compactenum} line did it for me in your example text.

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.