添加 hyperref 包导致错误

添加 hyperref 包导致错误

我正在使用“unc_dissertation”类,可以在这里\usepackage{hyperref}。除非我添加到序言中,否则一切都会正常进行。如果我\usepackage{hyperref}在“%% 我添加的包”下面(或其他地方)添加,我会收到大量错误。这是一个问题,因为我想添加指向目录和其他图形/公式/部分引用的链接。我该如何让它工作?

作为参考,这里是在职的前言

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% HEADER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt]{unc_dissertation}

%Font packages
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}

%Bilbiography styles
\bibliographystyle{ieeetr}

% List of acronyms
\usepackage{longtable}
\usepackage[acronym]{glossaries}

%% Math Packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{bbm}
\usepackage{amssymb}
\usepackage{geometry}

%% Reduce spacing between paragraph and section title %%%%%%%
%% @todo: Put this modification in the class file itself.
\usepackage{titlesec}
\titlespacing*{\section}
{0pt}{-5pt}{0pt}
\titlespacing*{\subsection}
{0pt}{-5pt}{0pt}
\usepackage{indentfirst}   %Indents first paragraphs in every section.

%% Flush footnotes to the left
\usepackage[hang,flushmargin]{footmisc}
%% Places footnotes immediately below horizontal rule
\setlength{\footnotesep}{0pt}

%% Normal LaTeX or pdfLaTeX? %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{ifpdf}

%% Packages for Graphics & Figures %%%%%%%%%%%%%%%%%%%%%%%%%%
\ifpdf %%Inclusion of graphics via \includegraphics{file}
    \usepackage[pdftex]{graphicx} %%graphics in pdfLaTeX
\else
    \usepackage[dvips]{graphicx} %%graphics and normal LaTeX
\fi


%% PACKAGES ADDED BY ME
\usepackage{xcolor}
\usepackage{hhline}
\usepackage{multirow}
\usepackage{rotating} %for a sideways figure
\setcounter{secnumdepth}{3} % to display subsubsection numbers
\setcounter{tocdepth}{3} % to display subsubsections in the TOC
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% DOCUMENT SETTINGS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Dissertation Title}
\author{My Name}
\committee{Prof 1}{Prof 2}{Prof 3}{Prof 4}{Prof 5}
\date{January 1, 1970}

\input{abstract.tex}

\dedication{To someone}

\dissdept{Department of Physics and Astronomy in the College of Arts and Sciences}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% GLOSSARIES AND ABBREVIATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% To update the printed glossary, you need to run:
% - pdflatex dissertation
% - makeglossaries dissertation
% - pdflatex dissertation
% On Windows, you might need to install Perl first.
\newacronym{unc}{UNC}{The University of North Carolina at Chapel Hill}
\makeglossaries

...这是我添加时出现的错误\usepackage{hyperref}


line 147: Undefined control sequence. \chapter{Motivation}
line 151: Undefined control sequence. ...ir MMUS: Principles, Design, and Imaging}
line 10: Argument of \Hy@setref@link has an extra }. ... are given in Fig.\,\ref{fig:Apparatus2}.}
line 10: Paragraph ended before \Hy@setref@link was complete. ... are given in Fig.\,\ref{fig:Apparatus2}.}
line 10: Extra }, or forgotten \endgroup. ... are given in Fig.\,\ref{fig:Apparatus2}.}
line 10: Missing \endgroup inserted. ... are given in Fig.\,\ref{fig:Apparatus2}.}
line 10: Missing } inserted. ... are given in Fig.\,\ref{fig:Apparatus2}.}
line 18: Paragraph ended before \Hy@setref@link was complete.
line 20: Paragraph ended before \Hy@setref@link was complete.
line 22: Paragraph ended before \Hy@setref@link was complete.
line 36: Paragraph ended before \Hy@setref@link was complete.
line 43: Paragraph ended before \Hy@setref@link was complete.
line 62: Paragraph ended before \Hy@setref@link was complete.
line 68: Paragraph ended before \Hy@setref@link was complete.
line 155: Undefined control sequence. ...aging Model Thrombi Under Pulsatile Flow}
line 7: Paragraph ended before \Hy@setref@link was complete.
line 11: Argument of \Hy@setref@link has an extra }. ...matic}a) was removed for this photograph.}
line 11: Paragraph ended before \Hy@setref@link was complete. ...matic}a) was removed for this photograph.}
line 11: Extra }, or forgotten \endgroup. ...matic}a) was removed for this photograph.}
line 11: Missing \endgroup inserted. ...matic}a) was removed for this photograph.}
line 11: Missing } inserted. ...matic}a) was removed for this photograph.}
line 16: Paragraph ended before \Hy@setref@link was complete.
line 40: Paragraph ended before \Hy@setref@link was complete.
line 69: Paragraph ended before \Hy@setref@link was complete.
line 71: Paragraph ended before \Hy@setref@link was complete.
line 74: Paragraph ended before \Hy@setref@link was complete.
line 98: Argument of \Hy@setref@link has an extra }. ...o produce a control phantom with no MNPs.}
line 98: Paragraph ended before \Hy@setref@link was complete. ...o produce a control phantom with no MNPs.}
line 98: Extra }, or forgotten \endgroup. ...o produce a control phantom with no MNPs.}
line 98: Missing \endgroup inserted. ...o produce a control phantom with no MNPs.}
line 98: Missing } inserted. ...o produce a control phantom with no MNPs.}
line 106: Argument of \Hy@setref@link has an extra }. ...ng system, see Fig.\,\ref{fig:Apparatus}}
line 106: Paragraph ended before \Hy@setref@link was complete. ...ng system, see Fig.\,\ref{fig:Apparatus}}
line 106: Extra }, or forgotten \endgroup. ...ng system, see Fig.\,\ref{fig:Apparatus}}
line 106: Missing \endgroup inserted. ...ng system, see Fig.\,\ref{fig:Apparatus}}
line 106: Missing } inserted. ...ng system, see Fig.\,\ref{fig:Apparatus}}
line 112: Paragraph ended before \Hy@setref@link was complete.
line 117: Paragraph ended before \Hy@setref@link was complete.
line 119: Paragraph ended before \Hy@setref@link was complete.
line 121: Paragraph ended before \Hy@setref@link was complete.
line 140: Paragraph ended before \Hy@setref@link was complete.
line 153: Paragraph ended before \Hy@setref@link was complete.
line 166: Paragraph ended before \Hy@setref@link was complete.
line 174: Paragraph ended before \Hy@setref@link was complete.
line 180: Paragraph ended before \Hy@setref@link was complete.
line 182: Paragraph ended before \Hy@setref@link was complete.
line 195: Paragraph ended before \Hy@setref@link was complete.
line 156: File ended while scanning use of \Hy@setref@link. \input{chapter3.tex}
line 159: Undefined control sequence. ...ytical Model and Experimental Validation}
line 5: Paragraph ended before \Hy@setref@link was complete.
line 9: Paragraph ended before \Hy@setref@link was complete.
line 16: Paragraph ended before \Hy@setref@link was complete.
line 37: Paragraph ended before \Hy@setref@link was complete.
line 64: Paragraph ended before \Hy@setref@link was complete.
line 87: Paragraph ended before \Hy@setref@link was complete.
line 116: Paragraph ended before \Hy@setref@link was complete.
line 120: Argument of \Hy@setref@link has an extra }. ... or the stiffness of the medium is low. }
line 120: Paragraph ended before \Hy@setref@link was complete. ... or the stiffness of the medium is low. }
line 120: Extra }, or forgotten \endgroup. ... or the stiffness of the medium is low. }
line 120: Missing \endgroup inserted. ... or the stiffness of the medium is low. }
line 120: Missing } inserted. ... or the stiffness of the medium is low. }
line 163: Undefined control sequence. \chapter{Chapter 5}
line 167: Undefined control sequence. \chapter{Chapter 6}
line 174: Undefined control sequence. ...dation of Gelatin Young's Modulus Recipe}
line 2: Paragraph ended before \Hy@setref@link was complete.
line 4: Paragraph ended before \Hy@setref@link was complete.
line 8: Argument of \Hy@setref@link has an extra }. ...ominal Young's moduli of 5 kPa and 10 kPa.}
line 8: Paragraph ended before \Hy@setref@link was complete. ...ominal Young's moduli of 5 kPa and 10 kPa.}
line 8: Extra }, or forgotten \endgroup. ...ominal Young's moduli of 5 kPa and 10 kPa.}
line 8: Missing \endgroup inserted. ...ominal Young's moduli of 5 kPa and 10 kPa.}
line 8: Missing } inserted. ...ominal Young's moduli of 5 kPa and 10 kPa.}
line 177: Undefined control sequence. ...Frequency Harmonics do not Confound MMUS}
line 14: Paragraph ended before \Hy@setref@link was complete.
line 16: Paragraph ended before \Hy@setref@link was complete.
line 180: Undefined control sequence. ...alytical Model of Single Particle Motion}
line 2: Paragraph ended before \Hy@setref@link was complete.
line 20: Paragraph ended before \Hy@setref@link was complete.
line 27: Paragraph ended before \Hy@setref@link was complete.
line 38: Paragraph ended before \Hy@setref@link was complete.
line 75: Paragraph ended before \Hy@setref@link was complete.
line 88: Paragraph ended before \Hy@setref@link was complete.
line 105: Paragraph ended before \Hy@setref@link was complete.
line 123: Paragraph ended before \Hy@setref@link was complete.
line 133: Paragraph ended before \Hy@setref@link was complete.
line 146: Paragraph ended before \Hy@setref@link was complete.
line 149: Paragraph ended before \Hy@setref@link was complete.
line 189: Paragraph ended before \Hy@setref@link was complete.
line 244: Paragraph ended before \Hy@setref@link was complete.
line 256: Paragraph ended before \Hy@setref@link was complete.
line 181: File ended while scanning use of \Hy@setref@link. \input{Appendix_Derivation.tex}
: old toc file detected, not used; run LaTeX again.
: old lof file detected, not used; run LaTeX again.
: old lot file detected, not used; run LaTeX again.
: No file dissertation.acr.
: `!h' float specifier changed to `!ht'.
: `h' float specifier changed to `ht'.
line 24: Float too large for page by 7.45953pt
: `h' float specifier changed to `ht'.
line 161: Float too large for page by 6.3705pt
: `!h' float specifier changed to `!ht'.
line 106: Overfull \hbox (8.35602pt too wide) in paragraph
: Label(s) may have changed. Rerun to get cross-references right.

感谢您的帮助!

答案1

我通过删除所有辅助文件并添加以下行来解决这个问题

\def\MakeUppercaseUnsupportedInPdfStrings{\scshape}

紧接着文档类,然后重新编译。显然 hyperref 和 \MakeUppercase 之间存在冲突。

相关内容