[Tex/LaTex] How to add a list of sections within a chapter at the start of every chapter

chapterssectioningtable of contents

As the title says, I want to basically list all of the sections within a chapter in a small table of contents at the beginning of every new chapter. See the image for clarification.
Graph Theory, by J.A. Bondy & U.S.R. Murty

Best Answer

Assumed that you did not do anything else to the layout of the chapter headings, this can be done quite easily by the twins »titlesec« and »titletoc« as in this approach.

\documentclass[11pt]{report}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{blindtext}  % drop in actual document

\titleformat{name=\chapter}[display]
{\normalfont\huge\bfseries}
{\chaptertitlename\ \thechapter}
{20pt}
{\Huge}
[\normalsize\normalfont\vspace*{1pc}%
\hbox{\large\bfseries\contentsname}\vspace{6pt}\titlerule\vspace{3pt}
\startcontents
\printcontents{l}{1}{\setcounter{tocdepth}{2}}\vspace{1pt}
\titlerule\vspace{1pc}]

\titleformat{name=\chapter,numberless}[display]
{\normalfont\huge\bfseries}
{}
{20pt}
{\Huge}

\setcounter{tocdepth}{0}

\begin{document}
  \tableofcontents

  \blinddocument  % drop in actual document
\end{document}

enter image description here


An alternative would be to use »minitoc«. This would come a bit closer to the layout that is shown on your screen capture.

\documentclass[11pt]{report}
\usepackage[T1]{fontenc}
\usepackage{minitoc}
\usepackage{lipsum}

\dominitoc
\setcounter{minitocdepth}{3}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{0}

\begin{document}
  \tableofcontents

  \chapter{Heading on level 0 (chapter)}
    \minitoc
    \section{Heading on level 1 (section)}
      \lipsum
      \subsection{Heading on level 2 (subsection)}
        \lipsum
        \subsubsection{Heading on level 3 (subsubsection)}
          \lipsum

  \chapter{Heading on level 0 (chapter)}
    \minitoc
    \section{Heading on level 1 (section)}
      \lipsum
      \subsection{Heading on level 2 (subsection)}
        \lipsum
        \subsubsection{Heading on level 3 (subsubsection)}
          \lipsum
\end{document}

enter image description here


And another alternative by the quite new »etoc«.

\documentclass[11pt]{report}
\usepackage[T1]{fontenc}
\usepackage{etoc}
\usepackage{lipsum}

\newcommand*\chaptertoc{%
  \setcounter{tocdepth}{3}%
  \etocsettocstyle{%
    \section*{\contentsname}\par%
    \hrule\vspace{3pt}%
    \setcounter{tocdepth}{2}%
  }{\vspace{3pt}\hrule}%
  \localtableofcontents
}

\begin{document}
  \tableofcontents

  \chapter{Heading on level 0 (chapter)}
    \chaptertoc
    \section{Heading on level 1 (section)}
      \lipsum
      \subsection{Heading on level 2 (subsection)}
        \lipsum
        \subsubsection{Heading on level 3 (subsubsection)}
          \lipsum

  \chapter{Heading on level 0 (chapter)}
    \chaptertoc
    \section{Heading on level 1 (section)}
      \lipsum
      \subsection{Heading on level 2 (subsection)}
        \lipsum
        \subsubsection{Heading on level 3 (subsubsection)}
          \lipsum
\end{document}

enter image description here