Customize table of contents hyperref
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 205
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
Right now the section numbers and section names are used as link when using hyperref in the table of contents. However, I find the amount of color on the table of contents too overwhelming, but I want to be consistent with coloring all links. I considered changing the links of the table of contents to page only, by using the linktocpage as stated on p.10 of https://mirror.lyrahosting.com/CTAN/macros/latex/contrib/hyperref/doc/manual.pdf
Now only the page numbers are blue, which is to be expected. However, I would like the section numbers to also be links. That would be a nice feature to have. E.g. set linktoc = numpage.
MWE
\documentclass{article}
\usepackage[hidelinks, colorlinks=true, allcolors=blue]{hyperref}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\section{First}
\lipsum[66]
\subsection{First first}
\lipsum[66]
\section{Second}
\lipsum[66]
\subsection{Second second}
\lipsum[66]
\end{document}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by compiling the supplied minimal working example and compare its table-of-contents links with the hyperref manual's linktoc and linktocpage options. Trace how hyperref builds table-of-contents entries, then verify that a numpage-style setting links both section numbers and page numbers while leaving section names unlinked.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- latex
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100