Is it possible to have hyperlinked entries in the ToC, while hyperlink is disabled in minitoc?
1 Answer
Yes. Load the minitoc
package before hyperref
. Immediately after loading minitoc
save the definition of \contentsline
, the macro that prints the entries, in another macro. Via the command \beforeminitoc
, restore the definition of \contentsline
from the stored value. The small catch is that in the meantime, hyperref
has changed the number of arguments required by \contentsline
from 3
to 4
, so you have to take that in to account in the code.
Table of contents:
Chapter:
\documentclass{book}
\usepackage{minitoc}
\let\stdcontentsline\contentsline
\usepackage{hyperref}
\renewcommand{\beforeminitoc}{\renewcommand{\contentsline}[4]{\stdcontentsline{##1}{##2}{##3}}}
\begin{document}
\dominitoc
\tableofcontents
\chapter{One}
\minitoc
\section{First section}
\section{Second section}
\end{document}