3

I am using enumerate (with the package enumitem) and want to make lists as in the example below.

Here is the first list: 
     1. Item 1.
     2. Item 2.
etc. 

Here is the second list: 
    (i) Item 1.
   (ii) Item 2.
  (iii) Item 3. This item is longer, to show how text should be aligned when it
        wraps after the end of a line. 

Here is an MWE. Setting labelindent gives the desired text wrap, but the items won't be aligned. Setting itemindent aligns the items, but messes up the text wrap.

\documentclass{article}
\usepackage{enumitem}

\begin{document}

\noindent First the result by setting ``labelindent". Here is the first list: 
\begin{enumerate}[leftmargin=*, labelsep=1.0em, labelindent=\parindent, 
itemsep=0.0em, topsep=0.5em, label=\arabic*.]
    \item Item 1.
    \item Item 2.
\end{enumerate}
Here is the second list: 
\begin{enumerate}[leftmargin=*, labelsep=1.0em, labelindent=\parindent, 
itemsep=0.0em, topsep=0.5em, label=(\roman*)]
    \item Item 1.
    \item Item 2. 
    \item Item 3. This item is longer, to show how text should be aligned when it 
    wraps after the end of a line. 
\end{enumerate}
Notice how the items in the two lists are not the same distance from the left 
margin. 

Now the solution with by setting ``itemindent". Here is the first list: 
\begin{enumerate}[labelsep=1.0em, itemindent=\parindent, itemsep=0.0em, 
topsep=0.5em]
    \item Item 1.
    \item Item 2.
\end{enumerate}
Here is the second list: 
\begin{enumerate}[labelsep=1.0em, itemindent=\parindent, itemsep=0.0em, 
topsep=0.5em, label=(\roman*)]
    \item Item 1.
    \item Item 2. 
    \item Item 3. This item is longer, to show how text should be aligned when it 
    wraps after the end of a line. 
\end{enumerate}
Notice how the text in the various items is the same distance from the left margin, except 
in the last line of the    last item. 

\end{document}

1 Answer 1

2

In my opinion, the usage of widest*=somenumber should be better, together with a special list clone.

\documentclass{article}
\usepackage{enumitem}

\begin{document}
\def\widestnumber{25}

\newlist{mylist}{enumerate}{1}
\setlist[mylist,1]{   
  leftmargin=40pt,
  labelsep=1.0em, %labelindent=\parindent, 
  itemsep=0.0em, 
  topsep=0.5em, 
  label=\arabic*.,
  widest*=\widestnumber}


\noindent First the result by setting "labelindent". Here is the first list: 
\begin{mylist}
    \item Item 1.
    \item Item 2.
\end{mylist}
Here is the second list: 
\begin{mylist}[label=(\roman*)]
    \item Item 1.
    \item Item 2. 
    \item Item 3. This item is longer, to show how text should be aligned when it 
    wraps after the end of a line. 
\end{mylist}
Notice how the items in the two lists are not the same distance from the left 
margin. 
\end{document}

enter image description here

5
  • Why the need to clone it, you can just define a new enumitem key that sets all those settings at once. Very useful feature. Commented Dec 3, 2015 at 19:29
  • @daleif: Yes, that's true. I thought to provide another list rather to keep the usual 'enumerate' untouched Commented Dec 3, 2015 at 20:54
  • Can this be modified to allow for normal paragraphs within an item? Commented Dec 5, 2015 at 0:05
  • @RandyRanderson: That's another question Commented Dec 5, 2015 at 0:08
  • tex.stackexchange.com/questions/281606/… Commented Dec 5, 2015 at 0:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.