章节标题未显示在 pdfbook 标记中:仅显示章节和小节

章节标题未显示在 pdfbook 标记中:仅显示章节和小节

我正在尝试使用包获取带有书签的论文的 PDF 输出hyperref。我能够让节和小节显示在书签中,但章节未显示。如何让章节标题显示在此 PDF 输出中?

\documentclass[12pt]{report}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}


\usepackage{uncc-thesis}
\usepackage{subfig}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{graphicx,epstopdf}
\usepackage{rotating} 
\usepackage{float}
\usepackage{color}
\usepackage[numbers, square, comma, sort&compress]{natbib}
\bibpunct{[}{]}{,\!}{n}{}{;}
\usepackage[breaklinks=true, bookmarks=true, pdftoolbar=true, linktocpage=true,colorlinks=true,citecolor=blue]{hyperref}

\usepackage{setspace}
\usepackage{tocloft}
\usepackage[font=small,format=plain,labelfont=bf,textfont=it]{caption}

\begin{document}

\pdfbookmark[0]{Abstract}{abstract}
\begin{abstract}
This is the abstract.
\end{abstract}

\pdfbookmark[0]{Dedication}{dedication}
\dedication
Here is the dedication.

\pagebreak{}
\pdfbookmark[0]{Acknowledgements}{acknowledgements}
\acknowledgments
Here is the acknowledgement.

\begin{singlespace}

\clearpage
\phantomsection
\tableofcontents
\label{toc}
\clearpage

\phantomsection
\listoftables
\label{lot}
\clearpage

\phantomsection
\listoffigures
\label{lof}
\end{singlespace}


\pagebreak{}
\pdfbookmark[0]{List of Abbreviations}{listofabbreviations}
\listofabbreviations
\input{List-of-Abbreviations}

\pagebreak{}
\pdfbookmark[0]{List of Symbols}{listofsymbols}
\listofsymbols
\input{List-of-Symbols}

\include{Chapter_One}

\include{Chapter_Two}
\include{Chapter_Three}
%\include{Chapter-Four}
%\include{Chapter-Five}


\bibliographystyle{ieeetr}

\bibliography{PhDThesis_Bibtex_Final} % References file

\end{document}

答案1

正如其他人所说,你应该hyperref最后加载所有包(你也应该subfig在之后加载)。然而,仅仅这样caption并不能解决这个问题。\@chapteruncc-论文.sty导致书签消失。

这似乎解决了问题。uncc-thesis包被加载,然后\@chapter被重新定义(再次),最后hyperref被加载。技巧MakeUppercase{\gdef...如下这里

\usepackage{uncc-thesis}

\makeatletter
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \MakeUppercase{\gdef\noexpand\@temp{#1}} %NEW - puts an upper case 
                                                                  %version of #1 in \@temp
                         \addcontentsline{toc}{chapter}%
                                   {\protect{\@chapapp~\thechapter:\ \@temp}}% CHANGED
                    \else
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%
%                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
%                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}
\makeatother

\usepackage[breaklinks=true, bookmarks=true, pdftoolbar=true, linktocpage=true,colorlinks=true,citecolor=blue]{hyperref}

相关内容