[Tex/LaTex] Center Aligning Labels in a enumerate environment

#enumerateenumitemhorizontal alignment

I am trying to get enumerate environment do the following:

     (subgroup)   some description of a subgroup of a group G.
      (hello!)    This subgroup is a hello subgroup of G and satisfies an
                  awkward  condition that it does not occur often!
    (long enough) It also satisfies long enough condition so that it is not trivial!

Based on the answer of Peter Grill and the ensuing discussion here, I came up with the following code:

\documentclass{article}
\usepackage{enumitem}
\SetLabelAlign{Center}{\makebox[1em]{(#1)}}
\begin{document}
\begin{enumerate}[align=Center]
\item[subgroup] Some description of a subgroup of a group $G$.
\item[hello!] This subgroup is a hello subgroup of G and satisfies an awkward  condition that it does not occur often!
\item[long enough] It also satisfies long enough condition so that it is not trivial!
\end{enumerate}
\end{document}

This leaves me with:

mwe.png

I'd be glad if somebody can help me fix this code!

Edit Playing around a little bit, I figure that increasing the \makebox width(?), I could get it to write things without overlapping. But, this breaks alignment. Could someone please explain this?

Best Answer

I would use a description list here instead of misusing itemize. In order for this to work you need to specify the longest label you will have. You need to have enumitem calculate the left margin for you, using leftmargin=!.

\documentclass{article}
\usepackage{enumitem}
\usepackage{calc}
\newlength{\mylongest}
\setlength{\mylongest}{\widthof{The longest label I will need}}
\addtolength{\mylongest}{\labelsep}
\SetLabelAlign{CenterWithParen}{\makebox[\mylongest]{(#1)}}
\begin{document}
\begin{description}[style=unboxed,align=CenterWithParen,labelwidth=\mylongest,leftmargin=!]
\item[Foo]{This is a foo item}
\item[FooBar]{This is a foobar item}
\item[A longer description]{A longer label}
\end{description}
\end{document}

output of code

Related Question