14

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?

2

1 Answer 1

15

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}
6
  • 7
    For this you need at least version 3.0 of enumitem.
    – Werner
    Oct 30, 2011 at 19:20
  • @Werner: Thanks for pointing that out. I did not think of mentioning that as it is part of the current released code as part of TeXLive2011. Oct 30, 2011 at 19:31
  • Thanks, that seems to be the solution. As a follow-up on this: Suppose I use \begin{enumerate}[label=(\roman*),align=Center], is it possible to make the parenthesis equally wide? '(i)', and '(iii)' on top of one another do not look very nice...
    – D.Roepo
    Oct 31, 2011 at 8:45
  • 1
    @user7091: If I understand correctly what you want, you can use something like \SetLabelAlign{Center}{(\makebox[1em]{\hfil#1\hfil})} and then \begin{enumerate}[label=\roman*,align=Center]\item...\end{enumerate}. Oct 31, 2011 at 13:53
  • @GonzaloMedina: Thanks. I updated the solution. but modified the parameter of the \makebox slightly as that made more sense to me. Please correct me if I am mistaken. Oct 31, 2011 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.