使用 Preprint JHEP 文档类显示 PDF 书签

使用 Preprint JHEP 文档类显示 PDF 书签

我喜欢在使用该类构建的文档中添加 PDF 书签JHEP.cls 3.1.5(该类现在已弃用)。

bookmarsnumbered我正在尝试使用该包的选项hyperref

\usepackage{hyperref} 
    \hypersetup{ 
        bookmarksnumbered,
        colorlinks=true, 
        linkcolor={}, 
        filecolor={},
        urlcolor={}, 
        }

在这里,我将 linkcolor 和 urlclor 保留为空白,因为这会导致另一个问题(Hyperref 导致目录中的章节编号前出现“红色”)。

虽然它似乎用书签生成了我想要的输出,但它给出了以下错误 Undefined control sequence

<recently read> \Hy@colorlink 
                              
l.1 ...e {1}The Relativistic String}{2}{section.1}
                                                  %
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
\close@pdflink ->\Hy@endcolorlink 
                                  \Hy@VerboseLinkStop \pdfendlink 
l.1 ...e {1}The Relativistic String}{2}{section.1}
                                                  %
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

我还不确定类文件中的哪个特定部分导致了这个问题,所以我package.cls通过Overleaf 项目具有以下 MWE:

\documentclass[12pt,hyper,letterpaper]{package}         % For preprint
\usepackage{hyperref} 
    \hypersetup{ 
        bookmarksnumbered,
        colorlinks=true, 
        linkcolor={}, 
        filecolor={},
        urlcolor={}, 
        }
\usepackage{amssymb,amsfonts}
\font\mybb=msbm10 at 10pt
\renewcommand{\arraystretch}{1.2}
\usepackage{epsfig}


\title{{\Huge String Theory}}
\author{}
\preprint{}

\abstract{}

\begin{document}

\newpage
\section{The Relativistic String}
\label{classical}

All lecture courses on string theory start with a discussion of the point particle. Ours is no exception. We'll take a flying tour through the physics of the relativistic point particle and extract a couple of important lessons that we'll take with us as we move on to string theory.

\end{document}

以避免这些错误的有效方法是什么?为此文档类生成 PDF 书签?

相关内容