# Description list with aligned descriptions

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}
{\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?

This is one possibility:

\documentclass{article}
\usepackage{calc}
\usepackage{enumitem}

\begin{document}

\begin{description}[leftmargin=!,labelwidth=\widthof{\bfseries The longest label}]
\item[The longest label] text
\item[Short]  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}


• Thanks for the leftmargin=! option! – paulequilibrio Nov 12 '16 at 15:28
• I might be doing something wrong, but the same description is giving me the following error: Something's wrong--perhaps a missing \item. ^^I\item[The longest label] – Jakub Arnold Jul 3 '19 at 15:38
• What does the leftmargin=! do? – debsim Nov 22 '20 at 15:34
• @JakubArnold I have seen the same error and it went away after including the enumitem package like shown in the example. Copying the options alone isn't enough. – tomka Mar 4 at 8:42

A solution using the scrextend package (taken from WikiBooks):

\documentclass[twocolumn]{article}
\usepackage{scrextend}
\begin{document}
\begin{labeling}{alligator}  % alligator is the longest label
\item [\textbf{ant}]really busy all the time
\item [chimp] likes bananas
\item [alligator] very dangerous animal, sharp teeth, long
muscular tail and a bit of text that is longer than one
line and shows the alignment of text quite nicely
\end{labeling}
\end{document}