3

I am using the "unc_dissertation" class, which can be found here. Everything works great unless I add \usepackage{hyperref} to the preamble. If I add \usepackage{hyperref} beneath "%% PACKAGES ADDED BY ME" (or anywhere else) I get a ton of errors. This is a problem because I would like to add links to my table of contents and other figure/equation/section references. How can I get this to work?

For reference, here is the working preamble

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 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

...and here are the errors I get when I add \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.

Thank you for your help!

5
  • the error messages you show have been re-formatted so they have no information, (texstudio?) can you show the actual errors from the log file so we can see which commands are undefined? May 27, 2021 at 18:09
  • unrelated to the error but you should replace \ifpdf %%Inclusion of graphics via \includegraphics{file} \usepackage[pdftex]{graphicx} %%graphics in pdfLaTeX \else \usepackage[dvips]{graphicx} %%graphics and normal LaTeX \fi by \usepackage{graphicx} May 27, 2021 at 18:11
  • 1
    If I add \stop to the end of the posted file and run it with pdflatex I get an error that abstract.tex is not found. If I comment out \input{abstract} (should that be in the preamble?) then it runs without error even if I add \usepackage{hyperref}. Clearly the errors shown are not from the posted code as that has no \chapter. Please post code that shows the error, and show the errors from the posted code. (posting errors from you original document is less useful) May 27, 2021 at 18:17
  • @DavidCarlisle I have not edited anything in the preamble except for the 6 lines following "%% PACKAGES ADDED BY ME." I'm not sure what you mean about the log file. I see that there is a file called "dissertation.log," but I do not know what to do with it. Am I supposed to copy and paste in the whole thing? It's massive. I'm not sure why \input{abstract.tex} goes before the beginning of the document, but it makes sense given its intended placement before the TOC. (It works just fine normally). I don't know what you want me to post. This is the document I'm working on...
    – Bunji
    May 27, 2021 at 20:11
  • start by fixing your posted code so that if you run it you get an error, then post the errors that you get from the posted code, not from your original document. You don't need to post the entire log file just the error message, the undefined command message from ! to ? in a code block so line endings are preserved. What you have posted (is it texstudio?) is a "summary" of the messages that hides the information about which command is undefined. Currently all we have is a posted code that makes no error, and an error summary from a document we can not see. That is impossible to debug May 27, 2021 at 20:38

1 Answer 1

2

I fixed this by deleting all auxiliary files, adding the line

\def\MakeUppercaseUnsupportedInPdfStrings{\scshape}

immediately after the document class, and recompiling. Evidently there was a conflict between hyperref and \MakeUppercase.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.