[Tex/LaTex] How to create a custom Table of Contents

table of contents

I need to write a document which will contain a preliminary table of contents for a report that I need to write couple of months later.

For that, I need to provide the preliminary outline, the question is, how to create a ToC with arbitrary entries in it (not related to the document which is being written now)?

Best Answer

You can use enumerate and to style it, use enumitem package.

\documentclass{article}
\usepackage{enumitem}
\usepackage{kantlipsum}
\begin{document}
  \kant[1-2]
  \begin{enumerate}[label=\arabic*,leftmargin=*,labelsep=2ex,ref=\arabic*]
    \item First chapter \dotfill 2
      \begin{enumerate}[label*=.\arabic*,leftmargin=*,labelsep=2ex]
        \item First section \dotfill 3
        \begin{enumerate}[label*=.\arabic*,leftmargin=*,labelsep=2ex]
        \item First sub section \dotfill 4
      \end{enumerate}
      \end{enumerate}
    \item Second chapter \dotfill 10
      \begin{enumerate}[label*=.\arabic*,leftmargin=*,labelsep=2ex]
        \item First section \dotfill 12
        \begin{enumerate}[label*=.\arabic*,leftmargin=*,labelsep=2ex]
        \item First sub section \dotfill 13
      \end{enumerate}
      \end{enumerate}
  \end{enumerate}
\end{document}

enter image description here

More styling like adjusting the vertical separation etc can be done and left as an exercise. For details, refer enumitem manual.

Related Question