[Tex/LaTex] Centre roman numbers in enumerate environment

#enumerateenumitemhorizontal alignmentlistsroman numerals

I have an enumerated list that uses roman numbers.

\documentclass{article}
\usepackage{enumitem}

\begin{document}
\begin{enumerate}[label=\roman*]
\item first entry
\item second entry
\end{enumerate}
\end{document}

Unfortunately the 'i' and the 'ii' are now left-aligned. Is it possible to centre the enumerating column?

Best Answer

The enumitem package comes with a left and right alignment built in. The currently released version, (v3.0) allows you to define a custom alignment via SetLabelAlign:

enter image description here

Here are two versions, one without the () and another with the (). Since you desired to have the parenthesis aligned as well, \makebox[1.0em] is used to ensure that the label is centered in a box of the specified width, so that the parenthesis will be just outside of this box and hence be aligned. If your list is very long, you might need to increase the size via using \makebox[1.5em] instead:

\documentclass{article}
\usepackage{enumitem}

\SetLabelAlign{Center}{\hfil#1\hfil}
\SetLabelAlign{CenterWithParen}{\hfil(\makebox[1.0em]{#1})\hfil}

\begin{document}
\begin{enumerate}[label=\roman*,align=Center]
\item first entry
\item second entry
\item third entry
\end{enumerate}

\hrule

\begin{enumerate}[label=\roman*,align=CenterWithParen]
\item first entry
\item second entry
\item third entry
\end{enumerate}
\end{document}