TeX - LaTeX Asked on November 28, 2020
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.
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:
phantomsectionprintbibliography
Correct answer by Ulrike Fischer on November 28, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP