This forum thread is exactly what I'm looking for. I want my description environment to produce this:
Label is long text
lab2 blalballalaa
label3 possible second rule
label four hello world
Someone offered this:
\newenvironment{mydescription}[1]
{\begin{list}{}%
{\renewcommand\makelabel[1]{##1:\hfill}%
\settowidth\labelwidth{\makelabel{#1}}%
\setlength\leftmargin{\labelwidth}
\addtolength\leftmargin{\labelsep}}}
{\end{list}}
Which works great (the parameter is the longest label), except I think the enumitem should be able to do this. Unfortunately, the documentation for it is extremely confusing to me. Could someone show me how to achieve the same result with enumitem?


leftmargin=!option! – paulequilibrio Nov 12 '16 at 15:28descriptionis giving me the following error:Something's wrong--perhaps a missing \item. ^^I\item[The longest label]– Jakub Arnold Jul 03 '19 at 15:38leftmargin=!do? – debsim Nov 22 '20 at 15:34enumitempackage like shown in the example. Copying the options alone isn't enough. – tomka Mar 04 '21 at 08:42\hfillbefore each item label (such as\item[\hfill Short]), then the labels will be right-aligned. Is there a better way to do this? – Paul Wintz Dec 31 '23 at 08:52