Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Nov 21 '12 at 16:48

This question came from our site for professional and enthusiast programmers.

    
Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. –  egreg Nov 21 '12 at 17:02

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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