How to link section titles back to toc? I want to use only hyperref
and not any toc related packages (answer with titlesec
can be found here)
I can do the hypertarget
to toc sections (answer provided by cmhughes and shown in the MWE below). Thus, my question really is: where to put the hyperlink
line?
\documentclass{report}
\usepackage{hyperref}
\let\oldcontentsline\contentsline%
\renewcommand\contentsline[4]{%
\hypertarget{toc#4}{}%
\oldcontentsline{#1}{#2}{#3}{#4}}
\begin{document}
\tableofcontents
\chapter{A Chapter to act as a Link}
\section{A Section to act as a Link}
\end{document}
Best Answer
Not sure if this is what you want