5

I want a list that looks exacly thus:

       Main text with paragraph indent.  Now the list.  Notice that the list labels
aligns with the left margin, the text and paragraphs thereafter with the paragraph indent

1.     sdf asdf asd fa sdf asd fa sdf as df asd fa sd fa sdf as df asd fas df asd 
fa sdf as df asd fas df asd fas d

       A paragraph under item 1. asdfasdfasdf asdfasdfasdf asdfasdfa sdfasdfasdf
asdfasdf asdfsadf asd fas df asd fas df

       1.1 a sub item asd asd asd asda sda sd as da sd as da sd asda sasd asd as d
asdasd asdas dasdas dasd asdasd 

2.     sdfs df sdf sdfsdf sdf sdf sd fs df sd fs df sdf s df sdfsdfsdfsdfsd fsdfs
sdf sdfsdfsdf

I am toying with these settings but can get it to work just right:

\parskip=0pt 
\parindent=1.5 cm

 \begin{enumerate}[align=left, leftmargin=0pt, labelindent=0pt,
listparindent=\parindent, labelwidth=0pt, itemindent=!]
   \item sdfasdas sdasd a asd asd asda sdasdasd asdasd asda sdasd asdasd asdasd asdasd asdasd sd

asdasd asdasd asd asd asd asd asd asd asdasdasd asdasdasd  asdasdasda sdasdasd asdasd asdasda sdasdas dasda sdaasdasd asdasd 

 asdasd asdasd asd asd asd asd asd asd asdasdasd asdasdasd  asdasdasda sdasdasd asdasd asdasda sdasdas dasda sdaasdasd asdasd 

 \end{enumerate}
5

With the enumitem package you need:

label=\arabic*.,      % define the label
align=left,           % align the label to the left
itemindent=\parindent,% fit the label and the space following in this width
labelwidth=\parindent,% fit the label and the space following in this width
labelsep=0pt,
listparindent=\parindent,
leftmargin=0pt,% New lines in paragraph are to be aligned on the left

fort the first level of the list. The secnd level is similar with slight tweaks:

enter image description here

Notes:

  • The showframe package was used just to show the page margins. It is not needed in your actual use case.

Code:

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

\newlist{MyEnumerate}{enumerate}{2}
\setlist[MyEnumerate,1]{
    label=\arabic*.,      % define the label
    align=left,           % align the label to the left
    itemindent=\parindent,% fit the label and the space following in this width
    labelwidth=\parindent,% fit the label and the space following in this width
    labelsep=0pt,
    listparindent=\parindent,
    leftmargin=0pt,% New lines in paragraph are to be aligned on the left
    }
\setlist[MyEnumerate,2]{% settings for second level 
    label*=\arabic*, start=1, % define the label
    align=left,           % align the label to the left
    itemindent=2\parindent,% fit the label and the space following in this width
    labelwidth=\parindent,% fit the label and the space following in this width
    leftmargin=0pt,% New lines in paragraph are to be aligned on the left
    }

\begin{document}
Main text with paragraph indent.  Now the list.  Notice that the list labels
aligns with the left margin, the text and paragraphs thereafter with the paragraph indent

\begin{MyEnumerate}
   \item sdfasdas sdasd a asd asd asda sdasdasd asdasd asda sdasd asdasd asdasd asdasd asdasd sd

    A paragraph under item 1. asdfasdfasdf asdfasdfasdf asdfasdfa sdfasdfasdf
asdfasdf asdfsadf asd fas df asd fas df

    \begin{MyEnumerate}
        \item a sub item asd asd asd asda sda sd as da sd as da sd asda sasd asd as d
    asdasd asdas dasdas dasd asdasd
    \end{MyEnumerate}

    \item sdfs df sdf sdfsdf sdf sdf sd fs df sd fs df sdf s df sdfsdfsdfsdfsd fsdfs
sdf sdfsdfsdf
 \end{MyEnumerate}
\end{document}
  • Thanks, but this is not correct. Notice your text under 1. is not wrapping all the way to the left as in my example. – Fred Nov 21 '14 at 21:12
  • @Fred: Sorry that I missed that detail. Have revised solution. – Peter Grill Nov 21 '14 at 23:41
  • Thanks. I still cannot get the second level to work. Please note the 1.1 a sub item as in my example above. – Fred Nov 22 '14 at 2:03
  • @Fred: Have revised the solution. It really would be so much better if you would just update the MWE with the appropriate input that should generate your desired output if things work properly. – Peter Grill Nov 22 '14 at 2:18
3

The following doesn't use the enumitem package but instead mimics a list by inserting the numbering at the correct location. The reason for this approach is because your setup seems to resemble regular paragraph text. As such, fiddling with list indentations can be tricky.

enter image description here

\documentclass{article}

\setlength{\parindent}{2em}
\renewcommand{\theenumii}{\theenumi.\arabic{enumii}}

\makeatletter
\newlength{\myenum@indent}
\setlength{\myenum@indent}{-\parindent}
\newenvironment{myenum}
  {\ifnum \@enumdepth >\thr@@\@toodeep\else
     \advance\@enumdepth\@ne
     \addtolength{\myenum@indent}{\parindent}%
     \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
   \fi%
   \setcounter{\@enumctr}{0}% Restart numbering
   \renewcommand{\item}{%
     \refstepcounter{\@enumctr}
     \noindent%
     \ifnum \@enumdepth >1 \hspace*{\myenum@indent}\fi%
     \makebox[\parindent][l]{\csname the\@enumctr\endcsname.}\ignorespaces}%
  }{}
\makeatother

\begin{document}

Main text with paragraph indent.  Now the list.  Notice that the list labels
aligns with the left margin, the text and paragraphs thereafter with the paragraph indent

\begin{myenum}
  \item sdf asdf asd fa sdf asd fa sdf as df asd fa sd fa sdf as df asd fas df asd 
        fa sdf as df asd fas df asd fas d

        A paragraph under item 1. asdfasdfasdf asdfasdfasdf asdfasdfa sdfasdfasdf
        asdfasdf asdfsadf asd fas df asd fas df

  \begin{myenum}
    \item a sub item asd asd asd asda sda sd as da sd as da sd asda sasd asd as d
          asdasd asdas dasdas dasd asdasd 

    \item a sub item asd asd asd asda sda sd as da sd as da sd asda sasd asd as d
          asdasd asdas dasdas dasd asdasd 
  \end{myenum}

  \item sdfs df sdf sdfsdf sdf sdf sd fs df sd fs df sdf s df sdfsdfsdfsdfsd fsdfs
        sdf sdfsdfsdf

  \begin{myenum}
    \item a sub item asd asd asd asda sda sd as da sd as da sd asda sasd asd as d
          asdasd asdas dasdas dasd asdasd 

    \item a sub item asd asd asd asda sda sd as da sd as da sd asda sasd asd as d
          asdasd asdas dasdas dasd asdasd 
  \end{myenum}

\end{myenum}
\end{document}
  • thanks but this also mde changes throughout my 120 page document. – Fred Nov 22 '14 at 1:53
  • @Fred: "this also made changes"? I guess I don't understand... you probably mean that you now have to make changes in your 120 page document to match my environment usage. Either way, I tried with the information you gave. – Werner Nov 22 '14 at 2:50
1

Here is a solution with the wide option of enumitem:

 \documentclass{article}
\usepackage{enumitem}
\setlist[enumerate] {labelsep = 0pt}
\setlist[enumerate, 1] {wide = 0pt, labelwidth = \parindent, listparindent = \parindent}
\setlist[enumerate, 2]{label =\theenumi.\arabic*, wide =\parindent, labelwidth = \parindent, leftmargin =0pt}

\begin{document}

Main text with paragraph indent. Now the list. Notice that the list labels
aligns with the left margin, the text and paragraphs thereafter with the paragraph indent

\begin{enumerate}
\item sdfasdas sdasd a asd asd asda sdasdasd asdasd asda sdasd asdasd asdasd asdasd asdasd sd

A paragraph under item 1. asdfasdfasdf asdfasdfasdf asdfasdfa sdfasdfasdf
asdfasdf asdfsadf asd fas df asd fas df
\begin{enumerate}%[wide = 0pt, labelwidth = \parindent, labelsep = 0pt, listparindent = \parindent]
   \item A sub item asd asd asd asda sda sd as da sd as da sd asda sasd asd as d
asdasd asdas dasdas dasd asdasd
\end{enumerate}
\item sdfs df sdf sdfsdf sdf sdf sd fs df sd fs df sdf s df sdfsdfsdfsdfsd fsdfs
sdf sdfsdfsdf
\end{enumerate}

\end{document} 

enter image description here

  • The example above does not include sub items. Please take a close look at example I provided. Thanks. – Fred Nov 22 '14 at 2:43
  • @Fred: Please take a look at my updated answer. I didn't notice subitems. Did you modify your question, or was I that absent-minded? – Bernard Nov 22 '14 at 3:22
  • Thanks. I did modify it soon after posting it so maybe you saw he earlier version. My apologies and thanks for your help. – Fred Nov 23 '14 at 21:20

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.