6

I want to create an indented list where new (non-itemized) paragraphs inside the list are not indented at all (that is, they are aligned with the left margin of the main text. See image below).

I am using the enumitem package with the following options:

labelsep=8pt,                           
labelindent=0.5\parindent,               
itemindent=0pt,
leftmargin=*,                         
listparindent=-\leftmargin

(the * should serve to calculate the value of \leftmargin from the other parameters and the automatically computed label width). However, this doesn't result as expected (see MWE below). If I set instead

leftmargin=3cm                         
listparindent=-\leftmargin

it works as intended (but I do not want to set the left margin to a particular value, what I want is a fixed \labelindent and \labelsep). Inserting

\noindent\hskip-\leftmargin

at the beginning of the offending paragraph also works, but is not very systematic indeed. How should I set the enumerate options to achieve what I want?

MWE

\documentclass{article}
\usepackage{enumitem}
\setlist[enumerate]{%
labelsep=8pt,%                           
labelindent=0.5\parindent,%               
itemindent=0pt,%
leftmargin=*,%                          
listparindent=-\leftmargin% 
}

\begin{document}
A normal paragraph of text just to show where 
the left margin lies, for comparison. New paragraphs 
inside enumerate should start at that left margin.

\begin{enumerate}[label=Case \arabic*:]
\item By setting the enumerate options in a 
(I think) sensible manner, I don't achieve what I want 

This paragraph shouldn't be indented at all!

\item I want to set the options so that new paragraphs 
behave like the following one

\noindent\hskip-\leftmargin 
This paragraph is indeed not indented at all!
\end{enumerate}

\begin{enumerate}[resume*,leftmargin=3cm,listparindent=-\leftmargin]
\item Setting a specific value for leftmargin also works\dots

But this is not what I want :-(
\end{enumerate}
\end{document}

enter image description here

I'd avoid doing this for all enumerate environment; define a new list for this.

4
  • Hi @summer, I think the labelindent=0.5 is causing your problem – try setting it to 0. If you want a comprehensive explanation of enumitem horizontal spacing, try here: tex.stackexchange.com/questions/184780/…. Dec 12, 2014 at 17:38
  • Thanks---also for the link---but I'm not sure this is the issue (by setting labelindent=0pt the problem persists), and in any case I do want the label to be indented. In my MWE everything behaves as I want except for the new paragraph indent. For me the puzzling fact is that with \leftmargin=3cm, \listparindent=-\leftmargin works, but with \leftmargin=* it doesn't.
    – summer
    Dec 12, 2014 at 17:56
  • Why not just end the list before the non-list paragraph? I don't understand why you want this...
    – cfr
    Dec 12, 2014 at 23:20
  • 1
    I admit in general it would be better to stop/resume the enumeration. But I have a document with many enumerations in the form of short items followed by an explanation paragraph. Stopping and resuming after each item (and that for a lot of enumerations) would make the code a bit cumbersome imho.
    – summer
    Dec 17, 2014 at 11:05

2 Answers 2

10

I'm not sure why you want to do this. However, here's the way:

\documentclass{article}
\usepackage{showframe}
\usepackage{enumitem}

\setlist[enumerate]{
  labelsep=8pt,
  labelindent=0.5\parindent,
  itemindent=0pt,
  leftmargin=*,
  before=\setlength{\listparindent}{-\leftmargin},
}

\begin{document}
A normal paragraph of text just to show where 
the left margin lies, for comparison. New paragraphs 
inside enumerate should start at that left margin.

\begin{enumerate}[label=Case \arabic*:]
\item By setting the enumerate options in a 
(I think) sensible manner, I don't achieve what I want

This paragraph shouldn't be indented at all!

\item I want to set the options so that new paragraphs 
behave like the following one

This paragraph is indeed not indented at all!
\end{enumerate}

\begin{enumerate}[resume*,leftmargin=3cm,listparindent=-\leftmargin]
\item Setting a specific value for leftmargin also works\dots

This is what I want.
\end{enumerate}
This is what I want. % just to show the left margin

\end{document}

You have to delay setting \listparindent when the value of \leftmargin has been determined.

enter image description here

0
2

Or wouldn't it be simply this (I find that a first paragraph with a non-zero leftmargin, and subsequent paragraphs in the item with a zero left margin doesn't look too good):

\documentclass{article}

\usepackage{enumitem}
\setlist[enumerate]{%
wide =0.5\parindent,
listparindent=0pt%
}%

\begin{document}
A normal paragraph of text just to show where the left margin lies, for comparison. New paragraphs
inside enumerate should start at that left margin.

\begin{enumerate}[label=Case \arabic*:]
\item By setting the enumerate options in a
(I think) sensible manner, I don't achieve what I want

This paragraph shouldn't be indented at all! This paragraph shouldn't be indented at all!

\item I want to set the options so that new paragraphs
behave like the following one.

This paragraph is indeed not indented at all!

\item Setting a specific value for leftmargin also works\dots

But is this what you want?
\end{enumerate}

\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .