Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I added the package minitoc \usepackage[nohints]{minitoc} to this template and did as I read: add \dominitoc before \tableofcontents and \minitoc after a chapter's creation, but it doesn't appear.

What am I missing?

share|improve this question

migrated from stackoverflow.com Dec 1 '11 at 20:34

1 Answer

up vote 3 down vote accepted

minitoc produces a file <jobname>.mtc? for each of the chapter-level sectioning commands in the thesis template (here ? denotes the current chapter-level section). So, if <jobname> is Thesis,

  • Thesis.mtc1 corresponds to "Declaration of Authorship"
  • Thesis.mtc2 corresponds to "Abstract"
  • Thesis.mtc3 corresponds to "Acknowledgements"
  • Thesis.mtc4 corresponds to "List of Figures"
  • Thesis.mtc5 corresponds to "List of Tables"
  • Thesis.mtc6 corresponds to "Abbreviations"
  • Thesis.mtc7 corresponds to "Physical Constants"
  • Thesis.mtc8 corresponds to "Symbols"
  • Thesis.mtc9 corresponds to "1 Chapter Title Here"
  • Thesis.mtc10 corresponds to "A Appendix Title Here"
  • Thesis.mtc11 corresponds to "Bibliography"

These files are created with a call to \dominitoc, which cycles through the chapter-level commands and extracts the relevant ToC entries associated with each chapter. The thesis documentclass Thesis.cls defines a command

\newcommand\addtotoc[1]{
  \refstepcounter{dummy}
  \addcontentsline{toc}{chapter}{#1}}

used throughout to add elements to the ToC at the chapter-level. As such, minitoc mistakenly mixes up the chapter numbering, as given above in the files generated after issuing \dominitoc.

To help minitoc in choosing the appropriate .mtc? file, we can set the minitoc ToC counter, or mtc, to the appropriate number before the chapter so that the extraction for the actual \minitoc associated with Chapter 1 is used. As such, use

\setcounter{mtc}{8}
\input{./Chapters/Chapter1} % Introduction
%...

since mtc is incremented with \chapter.

On a side note, one can see that only Thesis.mtc9 has a file size greater than 0 bytes, while all others are empty, since they produce no sub-chapter-level ToC entries.

enter image description here

share|improve this answer
Thank you so much! :D It has worked perfectly for me too. I wanted to up-vote you but I don't have enough reputation x.x . Thanks again! :D – Carlos Dec 2 '11 at 13:42
1  
@Carlos: Yes, upvoting (with the upward pointing arrow to the left of it) requires at least 15 reputation points - something you'll gain soon on this Q&A. However, you can accept the answer (by clicking on the checkmark below the voting buttons). It assigns reputation points to the author of the answer (and to you! +2). – Werner Dec 2 '11 at 14:59
Arf.. I just spent four hours wasting my time looking for answer between my mtc files and other comments, and here it is... So clearly explained, thank you so much! – user18028 Aug 26 '12 at 12:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.