我试图将目录链接到 my.tex 文件的各个章节等,然后将其导出为 .pdf。但是,我遇到了参考书目的链接问题。目录中的参考书目链接已链接,但它链接到了它之前的章节。我的代码如下。有什么想法吗?
\documentclass[12pt]{report}
\usepackage{STAT3585,amsfonts}
\usepackage{graphicx}
\usepackage{pstcol}
\usepackage{float}
\usepackage{amsmath}
\usepackage{color}
\usepackage[colorlinks = true,
linkcolor = black,
urlcolor = black,
citecolor = blue,
anchorcolor = blue]{hyperref}
\usepackage{cancel}
\usepackage{polynom}
\usepackage{amsthm}
\usepackage{multicol}
\usepackage{amssymb}
\usepackage{comment}
\newtheorem{thm}{Theorem}[chapter]
\newtheorem{lem}{Lemma}[chapter]
\newtheorem{exa}{Example}[chapter]
\newtheorem{cor}{Corollary}[chapter]
\newtheorem{note}{Note}[chapter]
\begin{document}
\chapter{Introduction}
\section{Basics}
\addcontentsline{toc}{chapter}{Bibliography}
\begin{thebibliography}{99}
\bibitem{} ....
\end{thebibliography}
\end{document}
答案1
您可以添加\phantomsection
来提供指向参考书目的链接的目标。确保\addcontentsline
在参考书目所在的页面上使用它(和您的),而不是像您的示例中那样在上一页使用。您可以通过\clearpage
在它们前面添加来确保这一点。
\documentclass[12pt]{report}
\usepackage{amsfonts}
\usepackage{graphicx}
% \usepackage{pstcol}
\usepackage{float}
\usepackage{amsmath}
\usepackage{color}
\usepackage[colorlinks = true,
linkcolor = black,
urlcolor = black,
citecolor = blue,
anchorcolor = blue]{hyperref}
\usepackage{cancel}
\usepackage{polynom}
\usepackage{amsthm}
\usepackage{multicol}
\usepackage{amssymb}
\usepackage{comment}
\newtheorem{thm}{Theorem}[chapter]
\newtheorem{lem}{Lemma}[chapter]
\newtheorem{exa}{Example}[chapter]
\newtheorem{cor}{Corollary}[chapter]
\newtheorem{note}{Note}[chapter]
\begin{document}
\tableofcontents
\chapter{Introduction}
\section{Basics}
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Bibliography}
\begin{thebibliography}{99}
\bibitem{} ....
\end{thebibliography}
\end{document}