13

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}
Red
  • 10,181

1 Answers1

29

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
\adjustmtc
\listoffigures
\adjustmtc
\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}

enter image description here

  • 1
    thanks! this works until there is no \listoffigures command after \tableofcontents. Do you know why? – Red Feb 08 '16 at 08:37
  • 1
    @Red: I'll try to figure out –  Feb 08 '16 at 08:39
  • 1
    Don't worry, I just got the solution. It is sufficient to add another \adjustmtc after \listoffigures – Red Feb 08 '16 at 08:41
  • @Red: Yes, found it too :-) But apparently, memoir and minitoc are not the best combination –  Feb 08 '16 at 08:42
  • 1
    Yes, I figured it out.. but unfortunately I'm too close to the deadline for changing this evil combination :-) – Red Feb 08 '16 at 08:44
  • @Red: Good luck and go ahead! –  Feb 08 '16 at 08:45
  • This does not work for me. Perhaps it is because I am importing separate files? – SumNeuron Dec 17 '16 at 02:54
  • The etoc package is a very good alternative (to minitoc). – Paul Gaborit Sep 23 '17 at 06:40
  • memoir and minitoc are the best cominbation :) when it comes to DESIGN :P – Erdinc Ay Aug 12 '19 at 11:21
  • For other people who might have similar problems: in my case, I had to add three consecutive \adjustmtcs before my first chapter. I noted that I can actually calculate the amount of \adjustmts required from the shift in the chapter TOCs: without any \adjustmtc, chapter and TOC were misaligned by three numbers; each \adjustmtc shifted the alignment by one. – Eike P. Oct 28 '20 at 23:52