TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently writing my PhD thesis, and I have trouble defining a common style for my global TOC and the partial TOCs generated by titletoc.

Basically if you check the following MWE, I like the general style of the global TOC, in particular the fact that hyperref links include the labels. However, I find that the dotted lines in the global TOC are not dense enough, and prefer those of the partial TOCs.




\newcommand{\PartialToc}{\vspace*{0.5pc}\vbox{\bf\large\noindent Chapter contents}\vspace*{0.3pc}\startcontents[chapters]\vspace*{0.3pc}\printcontents[chapters]{p}{1}{}\vspace*{0.3pc}}


% Custom style for partial TOCs


\chapter{Chapter 1}


\section{Section 1}

    \caption{Figure 1}

\section{Section 2}
\subsection{Subsection 2.1}
\subsection{Subsection 2.1}
\section{Section 3}

    \caption{Table 1}


Therefore, I tried to increase the density of the dotted lines in the global TOC, by adding the following titletoc style declarations after \begin{document}:


However, in this case, the hyperref links are changed, which I would like to avoid (no I am not a maniac...). Is there a way to achieve this ? And can this also be used to make the hyperref links in the partial TOCs include the labels ?

And as a subsidiary question, how do I assign the same style to entries in the List of Figures and List of Tables ?

Thank you for your help

share|improve this question
up vote 5 down vote accepted

The titlesec/titletoc packages are somewhat incompatible with hyperref, and you happened to run into such a situation.

To get the links on the labels in the ToCs back, we have to teach that to titletoc with:

  [3.8em]% left
  {}% above code
  {\contentslabel[\hyperlink{section.\thecontentslabel}{\thecontentslabel}]{2.3em}}% numbered entry format
  {\hspace*{-2.3em}}% unnumbered entry format
  {\titlerule*[0.25pc]{.}\contentspage}% filler page format
  {}% below code


% Custom style for partial TOCs


That is, the format of the contentslabel is changed from being simply \thecontentslabel to a proper hyperlink.

To obtain the narrow dots line in the LoT and LoF I would use package tocloft. This package can also handle the ToC, so you may find that titletoc is superfluous. Just use

share|improve this answer
Thank you for your answer, this solution is working well for the global TOC and the partial TOCs. It even works with the listofalgorithms, which is unexpected, as it does not for the listoffigures and listoftables. I looked in the .lof and .lot files to look for the problem, and in those files the label format is different : figure.caption.<number> and table.caption.<number>. The problem is that this <number> is unrelated with the actual label of the figure or table. Any idea to have this solution work for the listoffigures and listoftables as well ? – AldurDisciple Mar 1 '13 at 12:48
@AldurDisciple Could you then please update your MWE? There are several often used packages that interfere with LoT and LoF, so I need to see how you do it. – mafp Mar 1 '13 at 13:39
Mmh, you're right, your solution was working with my initial MWE. I am using a lot of packages in my actual document, but it seems that the format modification is due to package caption. I updated my MWE accordingly. – AldurDisciple Mar 1 '13 at 13:52
So, I have been desperately trying to understand why package caption changes the entry labels in the LOF and LOT files, but in vain for now... I tried using package tocloft as suggested, however it creates problems when used with package titletoc, which I need for the partial TOCs and to fix something in the page headers. – AldurDisciple Mar 4 '13 at 15:12
@AldurDisciple Is it important? I updated my answer to style the LoT and LoF, and this works with caption, too. Do you need anything else? – mafp Mar 4 '13 at 15:53

I found part of the answer to my question, related to the List of Figures and List of Table. In these lists, to assign the same style than in the TOC, you have to use the following commands.


However, for some reason that I don't get, it has to be put before \begin{document}, otherwise it does not work.

share|improve this answer
Answering your own question is great. However you shouldn't ask a question inside your answer ;-) -- In my opinion you should provide a new question related to this one. – Marco Daniel Mar 1 '13 at 10:54
I understand. I thought this would maybe update the question so that more people would be able to see it, but it didn't. I will remove it. – AldurDisciple Mar 1 '13 at 12:33

Your Answer


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.