1

Here, I removed chapter numbering for some chapters and sections without removing them from ToC using

\chapter*{Acknowledgments}
\addcontentsline{toc}{chapter}{Acknowledgments}

and I've tried to add a mini table of contents using \usepackage{minitoc} and \minitoc.

Here my code Latex :

\documentclass{report}

\usepackage{minitoc}
\usepackage[colorlinks=true,urlcolor=blue
           ,citecolor=blue,linkcolor=blue,bookmarks=true]{hyperref}


\begin{document}
\dominitoc
\tableofcontents
\chapter*{Acknowledgments}
\addcontentsline{toc}{chapter}{Acknowledgments}
\minitoc


\section*{Acknowledgments 1}
\addcontentsline{toc}{section}{Acknowledgments 1}




\chapter{Introduction}
\minitoc
\section{sec1}
\section{sec2}
\end{document}

But : - no mini ToC was created for the first chapter (with removed numbering) - and the mini Toc in the 2nd chapter was these for the 1st one. enter image description here thank you for help

Math
  • 153
  • I've used these two solutions in my code https://tex.stackexchange.com/questions/110840/how-to-remove-chapter-numbering-without-removing-it-from-tableofcontents and https://tex.stackexchange.com/questions/3001/list-sections-of-chapter-at-beginning-of-that-chapter – Math Aug 23 '17 at 10:10

1 Answers1

2

Explicit \addcontentsline commands on \minitoc - chapter level confuse minitoc.

Use \addstarredchapter{Acknowledgments} instead, it is a minitoc command.

The \addcontentsline for the section* entry is alright, however, since it goes to the correct ToC.

Please note that \addstarredchapter is only for the ToC entry, the \chapter* macro is still needed.

For other purposes with \doparttoc and \dosecttoc there are \addstarredpart and \addstarredsection macros respectively.

\documentclass{report}

\usepackage{minitoc}
\usepackage[colorlinks=true,urlcolor=blue
           ,citecolor=blue,linkcolor=blue,bookmarks=true]{hyperref}


\begin{document}
\dominitoc
\tableofcontents

\clearpage
\chapter*{Acknowledgments}
\addstarredchapter{Acknowledgments}
\minitoc


\section*{Acknowledgments 1}
\addcontentsline{toc}{section}{Acknowledgments 1}




\chapter{Introduction}
\minitoc
\section{sec1}
\section{sec2}
\end{document}

enter image description here