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.

1

1 Answer 1

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
1
  • Thank you so much!
    – raf
    Oct 6, 2020 at 11:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .