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

1

1 Answer 1

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

1
  • @Math: You're welcome. Happy TeXing.
    – user31729
    Commented Aug 23, 2017 at 15:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .