5

I'm trying to tweak the way nested lists appear for enumerate. Right now, using enumitem package, I've got something like this:

\documentclass{article}
\usepackage{enumitem}

\begin{document}
\begin{enumerate}[label*=\arabic*.,leftmargin=0pt]
  \item First
  \begin{enumerate}[label*=\arabic*.,leftmargin=0pt]
    \item Second
    \begin{enumerate}[label*=\arabic*.,leftmargin=0pt]
      \item Third
    \end{enumerate}
  \end{enumerate}
  \item Fourth
\end{enumerate}

\end{document}

The above creates a list like:

    1. First
  1.1. Second
1.1.1. Third
    2. Fourth

And I'd like it to look like:

1.     First
1.1.   Second
1.1.1. Third
2.     Fourth

This will be an extremely long 'list,' as it is actually a procedure, and could contain hundreds of steps with varying substeps. This is really the one thing I can't seem to figure out for my needs. I believe I can do it with trial/error by customizing varying alignments using \SetLabelAlign, but if there's an easier/simpler way - that would be wonderful.

Also, if there's a better way in general to do what I want, (step numbering with nested steps from # to #.#.#.) I'm all ears.

7

Try setting your own alignment to something that contains the enumeration in a fixed-width box. This way you can specify the location to suit your needs:

enter image description here

\documentclass{article}
\usepackage{enumitem}
\SetLabelAlign{fixedwidth}{\hss\llap{\makebox[2.5em][l]{#1}}}
\setlist[enumerate]{label*=\arabic*.,leftmargin=0pt,align=fixedwidth}

\begin{document}

\noindent Some text before.

\begin{enumerate}
  \item First
  \begin{enumerate}
    \item Second
    \begin{enumerate}
      \item Third
    \end{enumerate}
  \end{enumerate}
  \item Fourth
\end{enumerate}

\noindent Some text after.

\end{document}
1
  • Perfect; that's exactly what I needed. Thank you! – Karl Hachmuth Apr 2 '15 at 13:00
0

Here is a solution:

\documentclass{article}

\usepackage{enumitem}

\begin{document}
\begin{enumerate}[label*=\arabic*.,wide =0pt, labelindent = 1em, leftmargin =*]
  \item First Text text text. Text text text.Text text text. Text text text. Text text text. Text text text.Text text text. Text text text.
  \begin{enumerate}[label*=\arabic*.,align = left]
    \item Second Some more text text text. Some more text text text. Some more text text text. Some more text text text. Some more text text text.
    \begin{enumerate}[label*=\arabic*., align = left]
      \item Third
    \end{enumerate}
  \end{enumerate}
  \item Fourth
\end{enumerate}

\end{document} 

enter image description here

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.