I'm quite new with Overleaf and I have following problem: I want to make clickable table of contents to my thesis. It turned out that package hyperref works only with numbered chapters and sections. I still have some unnumbered chapters like abstract, foreword and introduction and I want to add them manually to toc.
So I decided to use the implementation where I try to figure out for example the page number of abstract with \pageref command, when there is created label inside of abstract with \label command.
Here is the example code:
\begin{abstract}
\label{hyp:abstract}
Some text...
\end{abstract}
.sty file
.
.
.
\addtocontents{toc}{\protect\contentsline{chapter}{ABSTRACT}{}{page.\pageref{hyp:abstract}} }
.
.
.
Edit: These chapters abstract, foreword and introduction are not exactly chapters but headers and own similar kind of structures compared to \chapter.
I have tried several ways of implemented this but always get hundreds of errors and I have no clue what is the proper way to do it. Thanks in advance!
