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.

Why does the following generate an error?

\documentclass{article}

\usepackage{enumitem}
\begin{document}
 \begin{description}[label=\emph{\alph*})]
 \item [aaa] bbbb
 \item [eee] əəəə 
 \end{description}
\end{document}
share|improve this question
    
If you add a brief description of your intent, we could suggest you a working alternative. –  Gonzalo Medina May 17 '12 at 15:09
    
@GonzaloMedina I just want to number description list items via a neat method. I also saw other similar questions but the answer was not so clear and neat –  PHPst May 17 '12 at 18:28
    
Please see my updated answer. –  Gonzalo Medina May 17 '12 at 19:25

3 Answers 3

up vote 13 down vote accepted

Description lists don't admit a label in the sense of the label key of the enumitem package.

According to a comment to the original question, the purpose is to get description items numbered; in this case, you can use an enumerate environment (setting the label key appropriately to get the desired numbering) and a variant of \item to emulate the format of a description list; something along these lines

\documentclass{article}
\usepackage{enumitem}

\newcommand\litem[1]{\item{\bfseries#1.\space}}

\begin{document}

\begin{enumerate}[label=\emph{\alph*)}]
 \litem{Term one} First term description.
 \litem{Term two} Second term description.
\end{enumerate}

\end{document}

enter image description here

share|improve this answer

The \item of description lists must be formatted with enumitem's font key (or its format synonym). Its last command can take an argument, so here's how to add a closing parenthesis after the item name:

\documentclass{article}

\usepackage{enumitem}

\newcommand*{\textitplusparen}[1]{\textit{#1)}}

\begin{document}

\begin{description}[font=\normalfont\textitplusparen]
\item [Item name] Some text
\end{description}

\end{document}

enter image description here

share|improve this answer

You can even use \item, provided you do some juggling of the macros:

\documentclass{article}
\usepackage{enumitem}

\newcommand{\changeitem}{%
  \let\latexitem\item
  \renewcommand\item[1][]{\latexitem\relax{\bfseries##1} }%
}
\newenvironment{descenum}[1][]
  {\begin{enumerate}[before=\changeitem,#1]}
  {\end{enumerate}}

\begin{document}

\begin{descenum}
 \item[Term one] First term description.
 \item[Term two] Second term description.
\end{descenum}

\end{document}

The descenum environment accepts all kind of options good for enumerate (as provided by enumitem), for instance

\begin{descenum}[label=(\arabic*)]
 \item[Term one] First term description.
 \item[Term two] Second term description.
\end{descenum}
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.