TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I reproduce the following list layout using the enumitem package? (I did it just manually with a table):

enter image description here

Note that the numbers should be aligned at the left border of the body (not total body).

I tried to tweak the different parameters of enumitem but everything was a mess.

share|improve this question
    
Are the numbers outside of the body or within? – Rico Jan 10 at 11:23
    
Within the body. If you want: draw a tangent the first ones and you get the boundary of the body. – student Jan 10 at 11:28
up vote 6 down vote accepted

Here's a possible way -- others may work of course too!

The labelling itself is quite easy with the label*=... syntax to use the parent level label.

The alignment is not so easy. All must be left aligned with respect to the left margin, so for deeper levels, the leftmargin must be all 0pt and the label width equal for all levels. The 30pt is just an arbitrary value here.

\documentclass{article}

\usepackage{showframe}

\usepackage{enumitem}


\setlist[enumerate]{align=left}
\setlist[enumerate,1]{labelwidth=30pt,leftmargin={\dimexpr\labelwidth+\labelsep}}
\setlist[enumerate,2]{labelwidth=30pt,leftmargin=0pt,label*={\arabic*}}
\setlist[enumerate,3]{labelwidth=30pt,leftmargin=0pt,label*={.\arabic*}}
\setlist[enumerate,4]{labelwidth=30pt,leftmargin=0pt,label*={.\arabic*}}

\usepackage{blindtext}

\begin{document}

\begin{enumerate}
\item \blindtext
\begin{enumerate}
\item \blindtext
\begin{enumerate}
\item \blindtext
\begin{enumerate}
\item \blindtext
\item \blindtext
\end{enumerate}
\end{enumerate}

\end{enumerate}
\end{enumerate}

\end{document}

enter image description here

Here's a shorter way, using a \newlist command:

\documentclass{article}

\usepackage{showframe}

\usepackage{enumitem}

\newlength{\mylabelwidth}
\setlength{\mylabelwidth}{40pt}


\newlist{leftenum}{enumerate}{4}
\setlist[leftenum]{align=left,labelwidth={\mylabelwidth},topsep=5pt,leftmargin=0pt,label*={\arabic*.}}
\setlist[leftenum,1]{leftmargin={\dimexpr\labelwidth+\labelsep}}

\usepackage{blindtext}

\begin{document}

\begin{leftenum}
\item \blindtext
\begin{leftenum}
\item \blindtext
\begin{leftenum}
\item \blindtext
\begin{leftenum}
\item \blindtext
\item \blindtext
\end{leftenum}
\end{leftenum}

\end{leftenum}
\end{leftenum}

\end{document}
share|improve this answer
    
The topsep distance should be redefined to be constant at all levels? – pluton Jan 10 at 11:54
    
@pluton: Well, you're right most likely. – Christian Hupfer Jan 10 at 17:37

Here is one way with enumitem:

\documentclass{article}
\usepackage{enumitem}
\usepackage{calc}
\usepackage[showframe]{geometry}
\usepackage{lipsum}

\setlist[enumerate]{wide=0pt, align=parleft, itemindent=0pt, labelsep=\widthof{9.9.9.9\quad}, leftmargin=0cm}
\setlist[enumerate, 1]{label=\thesection.1, leftmargin=\widthof{9.9.9.9\quad}}
\setlist[enumerate, 2]{label=\theenumi.\arabic*}
\setlist[enumerate, 3]{label=\theenumii.\arabic*}
\setlist[enumerate, 4]{label=\theenumiii.\arabic*}

\begin{document}

\setcounter{section}{1}
Some text some text some text some text some text some text some text some text some text some text some text.
\begin{enumerate}
  \item \lipsum[2]
        \begin{enumerate}
          \item\label{test} \lipsum[2]
          \item We can see from \ref{test} cross-references work.
                \begin{enumerate}
                  \item\label{test} \lipsum[3]
                \end{enumerate}
        \end{enumerate}
\end{enumerate}

\end{document}%

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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