[Tex/LaTex] modify enumerate environment to pre-pend characters before the number

#enumeratelists

i would like to generate an enumerated list that looks like this:

D.4(1) Something (else): plaintext.

D.4(2) Something (else): plaintext.

etc.

in other words, the counter is after some other text, which is constant. i could live without the bold/ital stuff after, as that is easy to do otherwise, but i'd really appreciate any tips on the other stuff.

Best Answer

When considering list manipulation, enumitem is king. Here's a small example duplicating your requested output:

enter image description here

\documentclass{article}
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\begin{document}
\begin{enumerate}[
    leftmargin=*,
    label={D.4(\arabic*)\ \textbf{\textit{Something} (else)}:},
    ref={D.4(\arabic*)}]
  \item plain text 1
  \item plain text 2
\end{enumerate}
\end{document}
  • label sets the way the label is displayed at each enumeration;
  • ref sets the way a reference to an item will be displayed (could be different from label); and
  • leftmargin adjust the left margin of the enumeration.

Of course, if D.4 is some other reference (or counter), like a chapter/section number, replace it with \thechapter/\thesection in label and ref.

More on the specifics involved, including making these setting globally active or creating your own lists (and not have to specify the options at each enumeration), see the enumitem documentation.