[Tex/LaTex] spacing in a description list using enumitem

descriptionenumitemlistsspacing

I found Description list with right alignment of labels while looking for a solution for my own problem. I tried to modify the above solution, but there are a few ugly things I don't know what to do about.

  1. Using noitemsep to remove the space between the items results in different spacing between lines in labelboxes and labelboxes to each other.
  2. If the text in the labelbox is too long and therefore a line break needed, then the second line of the text belonging to the label starts after the labelbox, not in the second line.

enter image description here

Here is the corresponding code:

\documentclass{article}  
\usepackage{enumitem}  
\SetLabelAlign{parright}{\parbox[t]{\labelwidth}{\raggedleft#1}}
\setlist[description]{style=multiline,leftmargin=3.5cm, align=parright,noitemsep}

\begin{document}

\begin{description}
  \item[here is a long long label] text
  \item[here is a long long label]  and here a long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long text
\end{description}

\end{document}

What can/should I do?

Best Answer

Here is:

\documentclass{article}  
\usepackage{enumitem}  
\SetLabelAlign{parright}{\strut\smash{\parbox[t]{\labelwidth}{\raggedleft#1}}}
\setlist[description]{style=multiline,leftmargin=3.5cm, align=parright,noitemsep}

\begin{document}

\begin{description}
  \item[here is a long long label] text\\\mbox{}
  \item[here is a long long label]  and here a long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long text
\end{description}

\end{document}

Note (1) I've added a \smash to the label, and (2) I've added an empty line by hand to the first item, to avoid the problem shown in the manual related to multiline labels.