# Minitoc of wrong chapter

I'm writing my Thesis and I want the general table of contents at the beginning of the document and the toc for every chapter at beginning of every chapter. For doing so I use the minitoc package.

If I put the \tableofcontents command at the end of the document all goes right. If instead I put it at the begin of the document the minitoc of first Chapter is not printed and the next ones are shifted. The second chapter has the minitoc of the first one, the third of the second and so on so forth.

\documentclass[a4paper,11pt,twoside]{memoir}
\usepackage{minitoc}

\dominitoc

\begin{document}

\tableofcontents
\listoffigures

\chapter{first}
\minitoc
\section{first first}
\section{first second}

\chapter{second}
\minitoc
\section{second first}
\section{second second}

\chapter{third}
\minitoc
\section{third first}
\section{third second}

\end{document}


memoir does some redefinitions of ToC features and apparently minitoc is confused by this.

However, there is a solution for this: minitoc provides the \adjustmtc[...] command, the optional argument is meant for adjusting the number of the minitoc, defaulting to one.

Saying \adjustmtc before the first \minitoc appears cures the problem.

I found this nice command hidden in the minitoc documentation when I tried to find a solution for this question: How can I put a minitoc before a chapter, on the facing page?.

Please note that minitoc is a package that is basically unmaintained since its author, J.P. Drucbert, died in 2009.

\documentclass[a4paper,11pt,twoside]{memoir}
\usepackage{minitoc}

\dominitoc

\begin{document}

\tableofcontents
\listoffigures
\chapter{first}

\minitoc
\section{first first}
\section{first second}

\chapter{second}
\minitoc
\section{second first}
\section{second second}

\chapter{third}
\minitoc
\section{third first}
\section{third second}

\end{document}


• thanks! this works until there is no \listoffigures command after \tableofcontents. Do you know why? – Red Feb 8 '16 at 8:37
• @Red: I'll try to figure out – user31729 Feb 8 '16 at 8:39
• Don't worry, I just got the solution. It is sufficient to add another \adjustmtc after \listoffigures – Red Feb 8 '16 at 8:41
• @Red: Yes, found it too :-) But apparently, memoir and minitoc are not the best combination – user31729 Feb 8 '16 at 8:42
• Yes, I figured it out.. but unfortunately I'm too close to the deadline for changing this evil combination :-) – Red Feb 8 '16 at 8:44