I'm writing my thesis and I woud like to add a minitoc at the beginning of each chapter. However, I don't like the standard format where the titles of the sections are listed as in the main TOC and I would like to align the titles on the same row (a format I saw in several books), maybe sperated by a comma or a textbullet. I mean something like this:
Chapter 1
Contents
1.1 Sec 1, 1.2 Sec 2, 1.3 Sec3, 1.4 Sec 4
I can do this for the main TOC through the titletoc package, but I need it for minitoc. Is there a way to have this customization of the minitoc? Thank you in advance.
Best Answer
Here's one possible solution using
titletoc
for both the main and the partial ToCs; thetitlesec
package was also used so that\chapter
will start and print its partial ToC automatically:The main ToC:
The partial ToCs:
and
Of course, your thesis will have some chapters that won't require a partial ToC such as those of the front and backmatter sections (Acknowledgements, Preface, Main ToC, possibly Appendices and the Bibliography). I did a improvement to my initial code defining a boolean to let you easily activate and deactivate the partial ToCs; initially the boolean is set to false, so the frontmatter chapters won't have partial ToCs; once you begin the mainmatter (in fact, whenever you want to start using partal ToCs) all you have to do is to set the boolean to true using
\chapterwithtoctrue
. For the backmatter (or, in general, to deactivate the partial ToCs) all you have to do is to set the boolean to false using\chapterwithtocfalse
; a complete example:This can be improved even more by appropriately patching (wuth the help of the
etoolbox
package, for example)\frontmatter
,\mainmatter
and\backmatter
.