I setup local table of contents for each chapter in a document using the following code:


The result looks like this:

enter image description here

Instead, I would like to have a line separation between the text Contents and the localtoc. It should look something similar to this:

enter image description here

I tried adding the line \noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}} before \etocsettocstyle{\addsec*{#1}}{}% but it is not working as desired.

Could someone please help?


You can use the minitoc package:


\chapter{Chapter title}

\section{Test 1}
\section{Test 2}
\section{Test 3}


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.