I kinda succeeded in doing with without using the enumitem
package, by doing this:
(disregard the lines, it's made with showframe
)
\newenvironment*{keywordlist}{%
\list{}{%
\setlength{\labelwidth}{\marginparwidth}%
\setlength{\labelsep}{\marglistsep}%
\setlength{\leftmargin}{0pt}%
\renewcommand*{\makelabel}[1]{\hss\marglistfont##1}%
}%
}{%
\endlist%
}
This works like a description
environment, but the labels are moved to the margin. The labels also align to the right, i.e. the text body, separated by \marglistsep
.
the long label in the middle shows what should happen if the label is too long to fit entirely in the margin.
Now, I tried doing this with the function set provided by enumitem
, but I got only this far:
\newlist{keywordlist}{description}{1}
\setlist[keywordlist]{style=multiline, labelsep=5pt, leftmargin=0pt, labelindent=-\marginparwidth}
This will put the labels into the margin, but I pretty much lost the separator value, and all labels are aligned to the left border, which puts a huge gap between the label and the text body. Which doesn't look too good. I like that I can make this label span multiple lines, which is why I'd like to use that over my first approach.
In essence, I'd kinda like to have best of both worlds, so the labels are aligned to the text body, could span multiple lines, but if one of those lines gets too long, it'll push the body contents inward.
align=right
? And please post a complete minimal document people can work with. That is much more useful than mere code fragments.