Shift with minitoc!

Maxime U. Garcia 2012-12-18
less than 1 minute read

Another post about LaTex, but you’re in the middle of your thesis redaction, and you finally found a solution to something that’s been bothering you for quite a time, it’s a good idea to keep it somewhere.

Here, all begun with a problem with the TOC (Table of Contents).

Some items in the TOC where associated with the wrong page numbers after compiling the tex file, so I used the tocbibind package who handles it fine, and finally I can stop fighting with:

\phantomsection
\addcontentsline{toc}{chapter}{}

But, by adding a TOT (Table of Tables) and a TOF (Table of Figures), the intern minitoc within each chapter became shifted. I got the minitoc from chapter 1 in chapter 4…

To prevent this, you should add \mtcaddchapter after declaring each TOC, TOT and TOF:

% TOC
\tableofcontents
\mtcaddchapter
% TOT
\listoftables
\mtcaddchapter
% TOF
\listoffigures
\mtcaddchapter
  • Bruno 2013-09-17

    great, Great, GREAT !! I’d to add these lines only for \listoffigures and \listoftables, but it work ! Thank a lot !

  • Maxime 2013-09-17

    Good to know I helped someone with that 😀

  • Maugan 2014-01-20

    Awesome! Thank you so much for this one!

  • Lucian 2014-02-24

    It worked… so nice, so beautiful. Thanks.

  • Zahid 2014-03-26

    Excellent tip. It worked for me.

  • kamoun 2014-07-15

    Excellent (I added the lines only for \listoffigures and \listoftables) 🙂

  • sniper 2015-05-27

    Merci bcp

  • litlesearcher 2015-08-14

    Hi thank a lot. Your post is awesome. I would like to add something. For my own document i where using bibliography by chapter, wich shifted my minitoc by one, every chapter. so, for whom get the same issue, just add \mtcaddchapter after every of your Biblibliography call. It worked for me

  • ed 2015-09-01

    excellent ! i had the issue of minitocs being shifted by one chapter (plus no minitoc displayed on the first chap) and it works fine for me as well when simply added after the \listoffigures and \listoftables. thanks a lot !

  • Maxime 2015-09-03

    I found out on StackExchange that you can also use \adjustmtc to prevent this problem: stackexchange.com/questions/236217

    Seems cleaner B-)

  • ange 2016-04-21

    waouhhhhhh…..merci oooooo merci beaucoup

  • iFeng 2016-09-23

    It helped me, Thank you!

  • besma 2016-10-21

    merci bien

  • Rania 2017-04-04

    Merci beaucoup!

Your email address will not be published