# Description list automatically adjusting style at different levels

Is is possible to have a description list which changes the style of the item label depending on the level of the list, i.e. and environment say description* which would make

\documentclass{article}

\begin{document}

\begin{description*}
\item[Point 1:] bla bla
\begin{description*}
\item[Subpoint 1.1 :] bla bla
\item[Subpoint 1.2 :] bla bla
\end{description*}
\item[Point 2:] bla bla
\begin{description*}
\item[Subpoint 2.1 :] bla bla
\item[Subpoint 2.2 :] bla bla
\end{description*}
\end{description*}

\end{document}


Look like

\documentclass{article}

\begin{document}

\begin{description}
\item[Point 1:] bla bla
\begin{description}
\item[\emph{Subpoint 1.1 :}] bla bla
\item[\emph{Subpoint 1.2 :}] bla bla
\end{description}
\item[Point 2:] bla bla
\begin{description}
\item[\emph{Subpoint 2.1 :}] bla bla
\item[\emph{Subpoint 2.2 :}] bla bla
\end{description}
\end{description}

\end{document}


or

\documentclass{article}

\begin{document}

\begin{description}
\item[Point 1:] bla bla
\begin{description}
\item[\normalfont{Subpoint 1.1 :}] bla bla
\item[\normalfont{Subpoint 1.2 :}] bla bla
\end{description}
\item[Point 2:] bla bla
\begin{description}
\item[\normalfont{Subpoint 2.1 :}] bla bla
\item[\normalfont{Subpoint 2.2 :}] bla bla
\end{description}
\end{description}

\end{document}


• I suggest the enumitem package – user31729 Apr 23 '15 at 20:12

Here are two solutions with the enumitem package, one based on the description environment, the other, based on enumerate, if the description text is always the same at a given level. I define for that a descrenum environment, which adds text to enumerate, and formats it:

\documentclass{article}
\usepackage[x11names]{xcolor}
\usepackage{enumitem}
\setlist[description, 2]{font= \mdseries\itshape}
\setlist[description, 3]{, font =\color{red}\mdseries\scshape, align = left}
\newlist{descrenum}{enumerate}{2}
\setlist[descrenum, 1]{label = Point \arabic*:, font = \bfseries, align = left,}
\setlist[descrenum, 2]{label = Subpoint \arabic{descrenumi}.\arabic*:, font = \scshape, align = left}

\begin{document}

\begin{description}
\item[Point 1:] bla bla Test test test test test test test test test test test test test test test test test test test test test test test test test
\begin{description}
\item[Subpoint 1.1 :] bla bla Test test test test test test test test test test test test test test test test test test test test test test test test test
\item[Subpoint 1.2 :] bla bla
\end{description}
\item[Point 2:] bla bla
\begin{description}
\item[Subpoint 2.1 :] bla bla
\begin{description}
\item[Subsubpoint 2.1 a:] bla bla
\item[Subsubpoint 2.1 b:] bla bla
\end{description}
\item[Subpoint 2.2 :] bla bla
\end{description}
\end{description}
\vskip1cm
\begin{descrenum}%
\item bla bla Test test test test test test test test test test test test test test test test test test test test test test test test test
\begin{descrenum}%
\item bla bla Test test test test test test test test test test test test test test test test test test test test test test test test test
\item bla bla
\end{descrenum}
\item bla bla
\begin{descrenum}
\item bla bla
\item bla bla
\end{descrenum}
\end{descrenum}

\end{document}


• @Martin Van der Linden: I modified my answer to add one level to the description environments. Is that what you mean (I don't speak of the aesthetic details…). – Bernard Apr 23 '15 at 21:21
• @Bernard: There is formatting error in your answer. ;-) – user31729 Apr 23 '15 at 22:07
• @Christian Hupfer: Thanks . Corrected now. There's also a questionable formatting in my answer…;o) – Bernard Apr 23 '15 at 22:25
• Thanks so much @Bernard, that's precisely what I was aiming at. – Martin Van der Linden Apr 23 '15 at 23:28

The automated list as a clone of enumerate (since I did not want to change the behaviour of enumerate itself.

Use \newlist{pointdescription}{enumerate}{2} to provide a clone of the enumerate lists, with a nesting level of two.

This will generate the counters pointdescriptioni and pointdescriptionii respectively.

Afterwards set an 'arbitrary' style for this new list:

\setlist[pointdescription]{label={\textbf{Point \arabic*:}} for the first level, see the example for the second one.

This list style can be changed anytime later on.

Note: The reference style has to be changed too, since this could look awkward otherwise. I refer to the enumitem manual.

\documentclass{article}

\usepackage{enumitem}
\begin{document}

\newlist{pointdescription}{enumerate}{2}

\setlist[pointdescription,1]{label={\textbf{Point \arabic*:}}}
\setlist[pointdescription,2]{itemindent=\leftmarginii,label={\emph{Subpoint \arabic{pointdescriptioni}.\arabic*:}}}

\begin{pointdescription}
\item bla bla
\begin{pointdescription}
\item bla bla
\item bla bla
\end{pointdescription}
\item bla bla
\begin{pointdescription}
\item bla bla
\item bla bla
\end{pointdescription}
\end{pointdescription}

\setlist[pointdescription,1]{label={\texttt{Point \arabic*:}}}
\setlist[pointdescription,2]{itemindent=\leftmarginii,label={\textsc{Subpoint \arabic{pointdescriptioni}.\arabic*:}}}

\begin{pointdescription}
\item bla bla
\begin{pointdescription}
\item bla bla
\item bla bla
\end{pointdescription}
\item bla bla
\begin{pointdescription}
\item bla bla
\item bla bla
\end{pointdescription}
\end{pointdescription}

\end{document}


• Since the request was for this to be automatic, surely you want to set the styles based on the level, as enumitem allows you to do, rather than setting them for each list. – Alan Munn Apr 23 '15 at 20:17
• @AlanMunn: I am right into it, i.e. just coding – user31729 Apr 23 '15 at 20:19
• Thanks @ChristianHupfer. Can't wait to see the longer version of your answer. Althought it is different from the example I posted in my question, I would also be interested in a more general solution which would allow to change the label of items on a case by case basis (while maintaining the same style at each level). But now that you hinted to enumitem, I might be able to figure it out myself. – Martin Van der Linden Apr 23 '15 at 20:22
• @MartinVanderLinden: See my edit – user31729 Apr 23 '15 at 20:36