I use enumerate
to create a second minimalistic TOC. The unnumbered chapters should be aligned with normal chapters.
So the unnumbered chapter Introduction should be aligned with the 1 from chapter Main Body and not with the text "Main Body".
Here's my MWE:
\documentclass[
a4paper,
10pt,
]{scrreprt}
\usepackage{setspace}
\usepackage{enumitem}
\spacing{1.5}
\setlength{\parindent}{0pt}
\begin{document}
List of the chapters, sections, items and sub-items.\\
\begin{enumerate}[label*=\arabic*]
\item[] Introduction
\item Main Body
\begin{enumerate}[label*=.\arabic*]
\item Main Body Section
\begin{enumerate}[label*=.\arabic*]
\item Main Body Subsection
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{document}
Best Answer
First of all note that the list numbering is right-aligned by default, as can be seen in this example:
This is so that large lists can still maintain an appropriate horizontal alignment if they have large (wide) labels. This alignment can be changed within
enumitem
with thealign
key-value. This is important because it is otherwise difficult to align an unenumerated item with the number of an enumerated one on-the-fly. Here are some options:If you really want the alignment to be perfect in the second case, then you can calculate the width of the label and use that instead of
\llap
:The value of the next item can also be calculated rather than using a fixed value: