TransWikia.com

Link only in the chapter names and the page in the TOC

TeX - LaTeX Asked on November 29, 2020

I’m looking for a way to customize the table of contents, so that all the page numbers contain the link to go to the section indicated, but in addition to only the chapters can also be clickable, and the subsections are inactive, in the image I put an example of what I’m trying. Everything that comes out in blue should be clickable. I tried with the hyperref package but I can only leave to all the texts or the numbers or both, I could not reach that level of customization.

Thank you very much in advance, and sorry if it is something very simple to achieve, but I am a bit new in this world and looking in google I have not found anything similar that can help me.
TOC links

PS:
an example of the current configuration of the table of contents would be this, but it only allows me to have the number of the page with the link and in blue:

documentclass[11pt]{book}

usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[none]{hyphenat}
usepackage{lipsum}

usepackage[hidelinks,pdfpagelabels,bookmarks,hyperindex,hyperfigures]{hyperref}
usepackage{bookmark}

hypersetup{
    linktoc=page,
    colorlinks=true,
    citecolor=blue,
    urlcolor=red,
    linkcolor=blue,
    citebordercolor={1 0 0},
    urlbordercolor={1 0 0},
    linkbordercolor={.7 .8 .8},
    breaklinks=true,
    }

begin{document}
tableofcontents

chapter{Chapter 1}
lipsum[1-2]
section{One dummy example}
lipsum[1-2]

chapter{Chapter 2}
lipsum[1-2]
section{One dummy example}
lipsum[1-2]
section{One dummy example}
lipsum[1-2]
end{document}

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP