# Enumerated description list

How can a list be created, whose items are both

• enumerated (a,b,c,d,...)
• and allow for setting a description via \item[texthere] ?

Im am using MikTex on Windows.

-
I think your question is a duplicate of Automatically number a description list –  Ignasi Sep 30 '11 at 10:48
Yes, it looks that way. However, I prefer Marco's answer to the one given in the other question, because Marco's answer can be used with the standard item[] command, rather than defining a new command \litem{} as Mike did. Hence the enumitem package can still be used straightforwardly for formatting the list without having to ask yourself: What did litem{} do again... –  Ben Oct 1 '11 at 18:17
@Ben: Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count. This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). –  Werner Oct 7 '11 at 23:25

EDIT

Comment of Ben:

Could I also have a separate listclass, say enumdescript, such that I don't have to apply the settings manually everytime I want to use one of those lists?

The package enumitem provides a simple way to define you own list environments. The command \newlist in combination with setlist are the relavant commands. With \newlist you can define you own list and via \setlist set the settings. In the following example I define the environment enumdescript with the depth 2. Both commands are well explained in the documentation.

\documentclass{scrbook}

\usepackage{enumitem}
\newcounter{descriptcount}
\newlist{enumdescript}{description}{2}
\setlist[enumdescript,1]{%
before={\setcounter{descriptcount}{0}%
\renewcommand*\thedescriptcount{\alph{descriptcount}}}
,font=\bfseries\stepcounter{descriptcount}\thedescriptcount~
}
\setlist[enumdescript,2]{%
before={\setcounter{descriptcount}{0}%
\renewcommand*\thedescriptcount{\roman{descriptcount}}}
,font=\bfseries\stepcounter{descriptcount}\thedescriptcount~
}
\begin{document}

\begin{enumdescript}
\item item one
\item item two
\item[Some Text] item three
\begin{enumdescript}
\item item one
\item item two
\item[Some Text] item three
\end{enumdescript}
\item item four
\item item five
\end{enumdescript}
\end{document}


Use the package enumitem in the newest version:

\documentclass{scrbook}

\usepackage{enumitem}
\newcounter{descriptcount}
\renewcommand*\thedescriptcount{\alph{descriptcount}}
\begin{document}

\begin{description}[%
before={\setcounter{descriptcount}{0}},%
,font=\bfseries\stepcounter{descriptcount}\thedescriptcount~]
\item item one
\item item two
\item[Some Text] item three
\end{description}

\end{document}


-
Thank you, that solves the problem. However, could I also have a separate listclass, say enumdescript, such that I don't have to apply the settings manually everytime I want to use one of those lists? –  Ben Oct 1 '11 at 18:01
@Ben: if the answer solves your problem, please check the mark under the voting counter. –  ℝaphink Oct 1 '11 at 19:17
I copy-pasted your solution (the one with the list definition)... It compiles, not no numbers or characters appear for the enumeration. The first solution with the inline-counter works however (although formatting is very different from the enum-lists)... How comes? –  fgysin Jan 31 '13 at 11:00

This is actually an enhancement of Marco Daniel’s answer and slightly off-topic with regard to the question. But I think, it still fits better here than elsewhere.

For a FAQ-list I needed an enumerated description list, where I could refer to the items, so I’ve added some things:

• I’ve added more custom counters (I needed 4) and redefined them

\newcounter{enumdesci}
\newcounter{enumdescii}[enumdesci] % note the optional reset value
\newcounter{enumdesciii}[enumdescii]
\newcounter{enumdesciv}[enumdesciii]
%
\renewcommand*{\theenumdesci}{\Roman{enumdesci}} % the default is "\arabic{enumdesci}"
\renewcommand*{\theenumdescii}{\theenumdesci.\Alph{enumdescii}}
\renewcommand*{\theenumdesciii}{\theenumdescii.\arabic{enumdesciii}}
\renewcommand*{\theenumdesciv}{\theenumdesciii.\alph{enumdesciv}}


I use four different representations for the counters here just for illustration.

If you need a period also after the last counter, take care where to add it (and where to remove in comparison to the version above; in my eyes the first variant above is better, the enddot could also be added in enumdescript definition below):

\renewcommand*{\theenumdesci}{\Roman{enumdesci}.}
\renewcommand*{\theenumdescii}{\theenumdesci\Alph{enumdescii}.}
\renewcommand*{\theenumdesciii}{\theenumdescii\arabic{enumdesciii}.}
\renewcommand*{\theenumdesciv}{\theenumdesciii\alph{enumdesciv}.}


Once defined I found this useful also for other lists, but now hyperref complained, that the counters were not unique (cf. hyperref documentation, as e.g. cited by mafp), so I had to add some lines straight after the others:

% for "hyperref", not needed without this or for a single list:
\newcounter{enumdesc}
\newcommand*{\theHenumdesci}{\theenumdesc\theenumdesci}
\newcommand*{\theHenumdescii}{\theenumdesc\theenumdescii}
\newcommand*{\theHenumdesciii}{\theenumdesc\theenumdesciii}
\newcommand*{\theHenumdesciv}{\theenumdesc\theenumdesciv}

• Now the part more or less adapted from Marco’s answer – defining a new list (here enumdescript) and setting the levels. Remember, I said, I needed 4.

\newlist{enumdescript}{description}{4}
%for a single list (without "hyperref" the "\phantomsection"s must be removed, too):
\setlist[enumdescript,1]{before={\setcounter{enumdesci}{0}},style=nextline,leftmargin=0pt,topsep=0.5\baselineskip,%
font={\phantomsection\normalfont\normalsize\bfseries\refstepcounter{enumdesci}\theenumdesci~}}
\setlist[enumdescript,2]{style=nextline,leftmargin=0.75em,labelindent=0.75em,topsep=0.5\baselineskip,%
font={\phantomsection\normalfont\normalsize\bfseries\refstepcounter{enumdescii}\theenumdescii~}}
\setlist[enumdescript,3]{style=nextline,leftmargin=1.5em,labelindent=1.5em,topsep=0.5\baselineskip,%
font={\phantomsection\normalfont\normalsize\bfseries\refstepcounter{enumdesciii}\theenumdesciii~}}
\setlist[enumdescript,4]{style=nextline,leftmargin=2.25em,labelindent=2.25em,topsep=0.5\baselineskip,%
font={\phantomsection\normalfont\normalsize\bfseries\refstepcounter{enumdesciv}\theenumdesciv~}}


Note the before={\setcounter{enumdesci}{0}} in the first level, which resets the counters, if you start a new list. I’ve also added some \phantomsections from the package “hyperref” and replaced \stepcounters for the possibility of referencing with \refstepcounters. The margins and labelindents should be adjusted according to the wanted indentation and used font. The style nextline could be changed for shorter items, see the “enumitem” documentation for that.

With hyperref and more than one list a command for increasing of the counter enumdesc must be added. This is best done in the before key of the first level definition. So this becomes

  %for more than one list and "hyperref":
\setlist[enumdescript,1]{before={\stepcounter{enumdesc}\setcounter{enumdesci}{0}},%
style=nextline,leftmargin=0pt,topsep=0.5\baselineskip,%
font={\phantomsection\normalfont\normalsize\bfseries\refstepcounter{enumdesci}\theenumdesci~}}

• For the internal “TOC” or overview (the FAQ is part of a bigger document) I defined an additional list with a new command:

\newlist{edtoclist}{itemize}{4}
\setlist[edtoclist,1]{label=\hspace*{1.25em},labelwidth=*,leftmargin=*}
\setlist[edtoclist,2]{label=\hspace*{1.3em},labelwidth=*,leftmargin=*}
\setlist[edtoclist,3]{label=\hspace*{2.1em},labelwidth=*,leftmargin=*}
\setlist[edtoclist,4]{label=\hspace*{3.0em},labelwidth=*,leftmargin=*}
\newcommand*{\edtitem}[2]{\item[\ref{#1}] \hyperref[#1]{#2}}


It must be 4 levels here also, of course. \hspace* needs manual adjustment depending on the font, your counter definition and the actual level depth. For the whole list one must take care of manually adjusting the levels according to the enumdescript levels. Also the items have to copied by hand.

All together (only 3 list levels used here):

\documentclass{article}

\usepackage[ngerman,english]{babel} % needed for "blindtext",
% "english" is the active language

\usepackage [pangram,random]{blindtext} % for some filler text
\usepackage{lipsum,kantlipsum} % also for filler text

\usepackage{enumitem}

\usepackage[%
]{hyperref}

%-----------------------%
% Further settings for "enumitem"
%-----------------------%
% Custom counters:
\newcounter{enumdesci}
\newcounter{enumdescii}[enumdesci]
\newcounter{enumdesciii}[enumdescii]
\newcounter{enumdesciv}[enumdesciii]
% Redefinition:
\renewcommand*{\theenumdesci}{\Roman{enumdesci}}
\renewcommand*{\theenumdescii}{\theenumdesci.\Alph{enumdescii}}
\renewcommand*{\theenumdesciii}{\theenumdescii.\arabic{enumdesciii}}
\renewcommand*{\theenumdesciv}{\theenumdesciii.\alph{enumdesciv}}
% For "hyperref":
\newcounter{enumdesc}
\newcommand*{\theHenumdesci}{\theenumdesc\theenumdesci}
\newcommand*{\theHenumdescii}{\theenumdesc\theenumdescii}
\newcommand*{\theHenumdesciii}{\theenumdesc\theenumdesciii}
\newcommand*{\theHenumdesciv}{\theenumdesc\theenumdesciv}
%
\newlist{enumdescript}{description}{4}
\setlist[enumdescript,1]{before={\stepcounter{enumdesc}\setcounter{enumdesci}{0}},style=nextline,leftmargin=0pt,%
font={\phantomsection\normalfont\normalsize\bfseries\refstepcounter{enumdesci}\theenumdesci~}}
\setlist[enumdescript,2]{style=nextline,leftmargin=0.75em,labelindent=0.75em,%
font={\phantomsection\normalfont\normalsize\bfseries\refstepcounter{enumdescii}\theenumdescii~}}
\setlist[enumdescript,3]{style=nextline,leftmargin=1.5em,labelindent=1.5em,%
font={\phantomsection\normalfont\normalsize\bfseries\refstepcounter{enumdesciii}\theenumdesciii~}}
\setlist[enumdescript,4]{style=nextline,leftmargin=2.25em,labelindent=2.25em,%
font={\phantomsection\normalfont\normalsize\bfseries\refstepcounter{enumdesciv}\theenumdesciv~}}
%-----------------------%
% Definition of a new list for own "TOC":
\newlist{edtoclist}{itemize}{4}
\setlist[edtoclist,1]{label=\hspace*{1.1em},labelwidth=*,leftmargin=*}
\setlist[edtoclist,2]{label=\hspace*{1.37em},labelwidth=*,leftmargin=*}
\setlist[edtoclist,3]{label=\hspace*{2.16em},labelwidth=*,leftmargin=*}
\setlist[edtoclist,4]{label=\hspace*{2.94em},labelwidth=*,leftmargin=*}
\newcommand*{\edtitem}[2]{\item[\ref{#1}] \hyperref[#1]{#2}}
%-----------------------%

\begin{document}

\section*{Overview}

% first level
\begin{edtoclist}
\edtitem{bltxt-xmpl}{blindtext'' examples}
% second level
\begin{edtoclist}
\edtitem{bltxt-xmplen}{English}
% third level
\begin{edtoclist}
\edtitem{bltxt-xmplen1}{Example~1}
\edtitem{bltxt-xmplen2}{Example~2}
\end{edtoclist}
% second level
\edtitem{bltxt-xmplde}{German}
% third level
\begin{edtoclist}
\edtitem{bltxt-xmplde1}{Beispiel~1}
\edtitem{bltxt-xmplde2}{Beispiel~2}
\end{edtoclist}
\end{edtoclist}
% first level
\edtitem{lkl-xmpl}{lipsum'' and derived kantlipsum''}
% second level
\begin{edtoclist}
\edtitem{lips-xmpl}{lipsum'' examples}
% third level
\begin{edtoclist}
\edtitem{lips-xmpl10}{Tenth section}
\edtitem{lips-xmpl20}{Twentieth section}
\end{edtoclist}
% second level
\edtitem{klips-xmpl}{kantlipsum'' examples}
% third level
\begin{edtoclist}
\edtitem{klips-xmpl15}{Fifteenth section}
\edtitem{klips-xmpl30}{Thirtieth section}
\end{edtoclist}
\end{edtoclist}
\end{edtoclist}

%\newpage

\section*{Examples}

% first level
\begin{enumdescript}
\item[blindtext'' examples\label{bltxt-xmpl}]
~\\[-2\baselineskip]
% second level
\begin{enumdescript}
\item[English\label{bltxt-xmplen}]
~\\[-2\baselineskip]
% third level
\begin{enumdescript}
\item[Example~1:\label{bltxt-xmplen1}]
\blindtext[1]
\item[Example~2:\label{bltxt-xmplen2}]
\blindtext[1]
\end{enumdescript}
% second level
\item[German\label{bltxt-xmplde}]
~\selectlanguage{ngerman}\\[-2\baselineskip]
% third level
\begin{enumdescript}
\item[Beispiel~1:\label{bltxt-xmplde1}]
\blindtext[1]
\item[Beispiel~2:\label{bltxt-xmplde2}]
\blindtext[1]
\end{enumdescript}
\selectlanguage{english}
\end{enumdescript}
% first level
\item[lipsum'' and derived kantlipsum''\label{lkl-xmpl}]
~\\[-2\baselineskip]
% second level
\begin{enumdescript}
\item[lipsum'' examples\label{lips-xmpl}]
~\\[-2\baselineskip]
% third level
\begin{enumdescript}
\item[Tenth section\label{lips-xmpl10}]
\lipsum[10]
\item[Twentieth section\label{lips-xmpl20}]
\lipsum[20]
\end{enumdescript}
% second level
\item[kantlipsum'' examples\label{klips-xmpl}]
~\\[-2\baselineskip]
% third level
\begin{enumdescript}
\item[Fifteenth section\label{klips-xmpl15}]
\kant[15]
\item[Thirtieth section\label{klips-xmpl30}]
\kant[30]
\end{enumdescript}
\end{enumdescript}
\end{enumdescript}

\end{document}


-

You can use the enumerate package for this:

\documentclass{scrbook}

\usepackage{enumerate}

\begin{document}

\begin{enumerate}[a)]
\item item one
\item item two
\end{enumerate}

\end{document}

-
Thank you for your answer, but when including this package, I get a lot of 'undefined control sequence' errors (maybe a clash with enumitem, don't know). Also I am looking for an enumerated, descriptive list. In your solution, I don't see where to put the description for the list items. I will go with Marco's solution since it worked by copy & paste. –  Ben Oct 1 '11 at 18:11

Another alternative to Raphink method is such:

You can make use of the itemize environment like the following:

\documentclass{article}

\begin{document}

\begin{itemize}
\item[a]
\item[b)]
\item[(c)]
\item[d.]
\end{itemize}

\end{document}


Producing the following output:

Notice how you are able to created different styles for your list of items using thing such as: ), ( ), . simultaneously if preferred for some reason.

Hope this was helpful to know.

-
Thank you for your answer, but I was looking for a solution that enumerates the items automatically (i.e. I don't want to type a,b,c etc). Marco's solution does that for me. –  Ben Oct 1 '11 at 18:06
Your Welcome. Understood: Mines is for if you want alteration in each enumeration or every other enumeration or any combination like that. For example, having 'a' be (a) and 'b' be b) and maybe 'c' being (c). Just one example. Instead of them all being the same like: a), b), c) vertically and so on. –  night owl Oct 1 '11 at 23:10
Also, I guess I did not thoroughly understand the question before posting either. Hence the \item[text here] which was desired. –  night owl Oct 1 '11 at 23:18