I will give an example of what I need exactly. The output should look like the default description list, with numbered labels.

REQ-ABC-001    Lorem Ipsum ...
     if the text is longer than a line, it is indent like normal description-lists.
REQ-ABC-002    Second item
REQ-ABC-003    and so on\label{req:label}

In the text those items should be referable as See~\ref{req:label} resulting in See REQ-ABC-003. This is my actual problem.

The list itself should be displayed by the following LaTeX code:

  \item Lorem Ipsum ...
  \item ... 

The parameter describes the inner part of the items' label (REQ is constant). I want to keep the usage very simple.

I have experimented with enumerate/description/list-environments. Each has its pros and cons but all had the same problem. I did not manage to change the output of \ref. When I am using enumitem with \newlist I do not see a way to include the parameter.

Anyone have an idea or a tip for me how to achieve this?

For convenience the display of the counter can be done like this. Just provide a counter.


2 Answers 2


This can be done with the help of the enumitem package; I defined the \threeatdigits command (similar to the kernel's \two@digits command) to add the necessary number of zeroes to the numbers:


% adds zeroes at the left of the number
\def\threeatdigits#1{\ifnum#1<10 00\else\ifnum#1<100 0\fi\fi\number#1}

\setlist[mylist]{label={REQ-\parameter-\protect\threeatdigits{\arabic*}}, leftmargin=*,



As can be seen in~\ref{a}
  \item \lipsum[1]\label{a}


enter image description here

  • Thank you so far. Except for the layout, this was one of my tries, but the parameter is still missing as described in the question. Any ideas for that problem?
    – Frank
    Commented Jun 27, 2011 at 20:56
  • @Frank: added. See my updated answer. Commented Jun 27, 2011 at 21:09
  • Am I right, that i need a wrapper environment to change \parameter before beginning the list itself? I guess that is a solution.
    – Frank
    Commented Jun 27, 2011 at 21:16
  • @Frank: perhaps you wrote your last comment while I was editing my answer. I had already included the necessary modifications. Commented Jun 27, 2011 at 22:34
  • Yes, that might be the case. But I have seen it shortly afterwards (while I just started writing it myself in the document). Thank you
    – Frank
    Commented Jun 29, 2011 at 21:56

A variation on Gonzalo's theme; this one shows how to register a counter representation for enumitem



\newcommand{\req}[1]{\expandafter\inreq\csname c@#1\endcsname}
  \ifnum#1<100 0\fi\ifnum#1<10 0\fi\number#1\relax}

In this way the code is neater, because it better separates form and contents.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .