0

I am trying to use the minitoc package to add contents to the beginning of each chapter. It dosen't seem to work, I have seen in the documentation that there might be problems when using starred chapters or

\addcontentsline{toc}{chapter}...

But whatever i try to include it dosen't seem to work... any suggestions ? maybe I am misplacing the \dominitoc or missing something here

\documentclass[a4paper,12pt,oneside]{report}

\usepackage{hyperref}
\hypersetup{colorlinks,citecolor=green,urlcolor=red}

\usepackage{minitoc}

% --------------------------------------------- %

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\pagenumbering{roman}

\begin{document}
\newcounter{rom}       

\begin{titlepage}
Some text   
\end{titlepage}

\newpage\thispagestyle{plain} 
\addtocounter{rom}{1}\setcounter{page}{2}~
\newpage\thispagestyle{plain}
\setcounter{page}{3}

\chapter*{Declaration}
\chapter*{Acknowledgements}

\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}

\cleardoublepage
\phantomsection
\dominitoc
\addcontentsline{toc}{chapter}{Contents}
{
  \hypersetup{linkcolor=black}
  \tableofcontents
}

\newpage\thispagestyle{plain}~
\clearpage
\pagenumbering{arabic}

\chapter{Introduction}
\minitoc
\section{Motivation}
\newpage\cleardoublepage

\chapter{background}
\section{Motivation}
\newpage\cleardoublepage

\end{document}
0

For some reason adding \adjustmtc before the \minitoc solves the prolem.

The problem was arising after using \addcontentsline and so I solved the problem by adding just as many \adjustmtc. So for the code provided in my question, the solution would look like this:

...
\chapter{Introduction}
\adjustmtc\adjustmtc
\minitoc
\section{Motivation}
\newpage\cleardoublepage
...
  • 1
    Please extent your answer to something anybody can compile such other uses do not have to build a document around this fragment – user31729 Jan 21 '18 at 20:59

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.