在下面的 MWE 中,目錄中的參考書目條目連結到參考書目所在的第 3 頁而不是第 5 頁。
如果我先然後\printbibliography
然後\addcontentsline
,那麼目錄中的條目連結到參考書目的最後一頁(這很難放在MWE中,但是請參閱這個另一個問題和第一個回复
(如果我省略\cleardoublepage
,那麼目錄條目將顯示錯誤的頁面並連結到錯誤的頁面)
\documentclass{book}
\usepackage{blindtext}
\usepackage{hyperref}
\usepackage{biblatex}
\addbibresource{library.bib}
\begin{document}
\tableofcontents
\chapter{Test}
\cite{Kullback1997}.
\blindtext
\cleardoublepage
\addcontentsline{toc}{chapter}{\bibname}
\printbibliography
\end{document}
和 .bib 檔案:
@Book{Kullback1997,
Title = {Information Theory and Statistics},
Author = {Kullback, S.},
ISBN = {9780486696843},
Publisher = {Dover Publications},
Series = {A Wiley publication in mathematical statistics},
URL = {https://books.google.com.sa/books?id=05LwShwkhFYC},
Year = {1997},
__markedentry = {[wolfersf:6]},
Lccn = {97014382}
}
答案1
您必須添加 a\phantomsection
作為錨點。但最好使用 biblatex 工具:
\documentclass{book}
\usepackage{blindtext}
\usepackage{hyperref}
\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\tableofcontents
\chapter{Test}
\cite{doody}.
\blindtext
%\cleardoublepage
%\phantomsection
%\addcontentsline{toc}{chapter}{\bibname}
\printbibliography[heading=bibintoc]
\end{document}