phd-thesis-template icon indicating copy to clipboard operation
phd-thesis-template copied to clipboard

Use of minitoc within template: minitoc not displayed

Open brentocarrigan opened this issue 4 years ago • 5 comments

Any other user's experience with minitoc package for inserting a mini table of contents into each chapter?

I have followed CUED guidance for using minitoc with their minimal reproducible document which works fine.

However, using the template a minitoc is not displayed when requested in each chapter. I have:

In thesis.tex:

\documentclass[a4paper,12pt,times,numbered,print,index]{Classes/PhDThesisPSnPDF}
% ********************** Insert minitoc *************************
\usepackage{minitoc}

and also in thesis.tex ensure \dominitoc is called before any indexing eg table of contents or list of figures

% ******************************** Front Matter ********************************
\begin{document}
\dominitoc 

Then in each chapter eg:

\chapter{Getting started}  %Title of the First Chapter

\minitoc

Any ideas welcome!

TexStudio 3.0.1 on Mac OS Mojave using TexLive

brentocarrigan avatar Dec 29 '20 00:12 brentocarrigan

Adding a comment in case interested for interested problem-solvers:

TexX logs include warnings W0023: It may be a consequence of the hyperref package and W0028: The \chapter command is altered after minitoc

There may be an issue with the order of packages loaded? minitoc documentation and this tex stackexchange post suggest loading minitoc before hyperref - so I have added \minitoc to the class file before \require{hyperref] but no luck.

Any ideas?

brentocarrigan avatar Jan 04 '21 23:01 brentocarrigan

If I add

\usepackage{minitoc} ... \begin{document} \dominitoc

to the sample thesis.tex, add \minitoc after each chapter command, then run latex a few times, the minitoc for chapter 1 appears in chapter 3.

Looking behind the scenes, thesis.mtc, thesis.mtc0, thesis.mtc1, thesis.mtc2 are empty. thesis.mtc3 contains the code for chapter 1's minitoc, thesis.mtc4 contains the code for chapter 1's minitoc, etc. So the chapter numbering is out of sync.

http://texdoc.net/texmf-dist/doc/latex/minitoc/minitoc.pdf might explain why this is. It's 637 pages though ...

TimLoveCambridge avatar Jan 08 '21 11:01 TimLoveCambridge

@brentocarrigan if I put \RequirePackage{minitoc} somewhere after \begin{document} in thesis.tex minitocs don't appear, but if I put it in PhDThesisPSnPDF.cls before the inclusion of hyperref then it appears.

@TimLoveCambridge I had the same issue and the solution is to write \adjustmtc[2] after \listoffigures and \listoftables in thesis.tex. (see https://tex.stackexchange.com/a/291744 or the manual page 34 ;)). Page 50 of the manual states this occurs because list of figures/tables appears in the TOC so gets registered as a chapter by minitoc.

It works for me now :-)

bricoletc avatar Jul 29 '21 16:07 bricoletc

I had to include \usepackage{etoc} to get this to work in overleaf :shrug:.

a-r-j avatar Jan 17 '23 14:01 a-r-j

@bricoletc
Thank you so much you saved my life

medch1 avatar May 10 '23 11:05 medch1