I use the hyperref package. However, the link in the table of content (toc) of "List of figures" (lof) leads to the toc instead of the lof. I have the \addcontentsline command before \listoffigures. Swapping them, I get the correct link but wrong page numbers in the toc. It seem to be only a problem if the lof is longer than one page. Does anybody how to get both the link and the number right?
Here is a minimum working example.
\documentclass[10pt]{article}
\usepackage{graphicx}
\usepackage{lipsum,forloop}
\usepackage[]{hyperref}
\begin{document}
\tableofcontents
\clearpage
\addcontentsline{toc}{section}{List of figures}
\listoffigures
\newcounter{ct}
\forloop{ct}{1}{\value{ct} < 25}%
{
\clearpage
\section{Another section}
\lipsum[1]
\begin{figure}[htb]
\centering
\includegraphics[width=0.2\linewidth]{example-image}
\caption{Example}
\end{figure}
\subsection{Another subsection}
\lipsum[1]
\begin{figure}[htb]
\centering
\includegraphics[width=0.2\linewidth]{example-image}
\caption{Example}
\end{figure}
}
\end{document}
\addcontentslineand add\usepackage{tocbibind}. – Marijn Oct 02 '17 at 09:57tocbibind, but for a general way to tellhyperrefwhere to jump, look at https://tex.stackexchange.com/questions/44088/when-do-i-need-to-invoke-phantomsection – Michael Palmer Oct 02 '17 at 17:46