I want to customize the links (appearance) in the TOC. In the entire document I use 'hidelinks' in hyperref (to turn of the box), and then have some fancy own link visualization (here for MWE replaced by dotuline
).
So I changed the TOC Format to include hyperlinks. I turned on the "link boxes" for debugging and the result does not look good. For the number the click area is too short, and for label it goes wrong competely.
\documentclass{book}
\usepackage{titletoc}
\usepackage{hyperref}
\usepackage{ulem}
\titlecontents{chapter}[1pc]%
{\addvspace{2ex}\Large\filright}%
{\hyperlink{chapter.\thecontentslabel}{\dotuline{\thecontentslabel}}{1pc}}{\hspace*{-1pc}}%
{\titlerule*[1pc]{.}\hyperlink{chapter.\thecontentslabel}{\dotuline{\contentspage}}}[]
\begin{document}
Link Customization: \hyperlink{chapter.1}{\dotuline{Jump to chapter 1}}
\tableofcontents
\chapter{Dummy1}
dummy
\end{document}
Original TOC:
With:
\titlecontents{chapter}[1pc]%
{\addvspace{2ex}\Large\filright}%
{\contentslabel[\thecontentslabel]{1pc}}{\hspace*{-1pc}}%
{\titlerule*[1pc]{.}\contentspage}[]