0

I am using the fphw.cls (gitlab link) class for my assignment template. But I have found that the hyperlink on my ToC to bibliography is not properly working. When I click on the bibliography section at my ToC (on PDF), it takes to the previous page of the bibliography. The problem is appearing only in the bibliography. The other hyper-references are working okay.

Here's my MWE:

\documentclass{fphw}    % Link to the fphw.cls file: https://gitlab.com/fportales/fphw/-/blob/master/fphw.cls
\usepackage[sorting=none]{biblatex} 
\usepackage[
     hidelinks,              % for removing the borders around clickable cross-references and hyperlinks 
     bookmarksopen,          % for PDF specific display option
     bookmarksnumbered,      % for PDF specific display option
]{hyperref}
\usepackage{bookmark}        % A new bookmark (outline) organization for hyperref
\usepackage{lipsum}

\title{ToC to Bibliography Problem} \addbibresource{ref_qm.bib} \begin{document} \pdfbookmark[section]{\contentsname}{toc} \tableofcontents \newpage \section{section name} \lipsum[1][5]\cite{book:griffiths} \ \lipsum \section{section name} \lipsum[2][5]\cite{book:balakrishnan} \ \lipsum \newpage \printbibliography[heading=bibintoc] \end{document}

How can I solve the issue? The fphw.cls file contains 126 lines of codes. That's why I haven't put it here. Kindly check the link.

raf
  • 633
  • A relevant thread according to the answer of @Ulrike Fischer: https://tex.stackexchange.com/q/44088/114006 – raf Oct 06 '20 at 11:14

1 Answers1

1

The fphw loads titlesec. titlesec is not fully compatible with hyperref. biblatex uses internally a \section* and a \addcontentsline command to setup the heading, but with titlesec it misses the anchor. The easiest is to add a \phantomsection manually:

\phantomsection\printbibliography
Ulrike Fischer
  • 327,261