% Based on the University of Toronto Thesis \LaTeXe\ Class. Also
% greatly improved the documentation by incorperating bits of
% the base/*.dtx files.}
+ % \changes{0.4}{2010/02/23}{W.~Trevor King repositioned hyperref
+ % inclusion for proper hyperref overriding. The previous
+ % implementation couldn't handle $\backslash$label for
+ % $\backslash$paragraph and some other section levels. The page
+ % number for the reference was correct, but the link went to the
+ % label's parent chapter.}
+% \changes{0.5}{2010/03/03}{W.~Trevor King use hypcap for better
+% caption hyperlink anchor placement.}
%
% \MakeShortVerb{\|}
% \newcommand{\pkg}[1]{\textsf{#1}}
%
% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/hyperref/}{\pkg{hyperref}}
% for hyperlinks. Not strictly necessary, but I can't imagine a
- % thesis without it.
- % \begin{macrocode}
- \RequirePackage[final]{hyperref}
- % \end{macrocode}
- % Nobody likes the default colored boxes. Color the text itself.
- % \begin{macrocode}
- \hypersetup{colorlinks}
- % \end{macrocode}
- % If we're writing a PDF, we set the |pdfauthor|, etc.\ arguments in
- % |\author|, etc.\ to avoid using |\AtBeginDocument| or some such.
+ % thesis without it. We actually include this later
+ % (Section~\ref{sec:hyperref-inclusion}), because \pkg{hyperref}
+ % sticks its fingers into \emph{everything} and we want it to use our
+ % versions of some macros (e.g. |\@sect|) but not others
+ % (e.g. |thebibliography|).
%
%
- % for placing caption hyperlink anchors. Not strictly necessary, but
- % we're using \pkg{hyperref}, and the poor link targets are annoying.
- % \begin{macrocode}
- \RequirePackage[all]{hypcap}
- % \end{macrocode}
- % \Lopt{all} redefines the figure and table environments to
- % place the anchor at the start of the float.
+% \subsubsection{\pkg{hypcap}}
++% \label{sec:hypcap}
+%
+% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/oberdiek/}{\pkg{hypcap}}
++% for placing caption hyperlink anchors. Must be included after
++% \pkg{hypercap}, so the actual inclusion is in
++% Section~\ref{sec:hypcap-inclusion}).
+%
+%
% \subsection{\LaTeX\ overrides and extensions}
%
% Here we change the behavior of a bunch of macros and environments
% \end{macro}
%
%
+ % \subsection{\pkg{hyperref} inclusion}
+ % \label{sec:hyperref-inclusion}
+ %
+ % This is the awkward \pkg{hyperref} inclusion. See
+ % Section~\ref{sec:hyperref} for an explanation of why we stash it
+ % here.
+ % \begin{macrocode}
+ \RequirePackage[final]{hyperref}
+ % \end{macrocode}
+ % Nobody likes the default colored boxes. Color the text itself.
+ % \begin{macrocode}
+ \hypersetup{colorlinks}
+ % \end{macrocode}
+ %
++% \subsubsection{\pkg{hypcap}}
++% \label{sec:hypcap-inclusion}
++%
++% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/oberdiek/}{\pkg{hypcap}}
++% for placing caption hyperlink anchors. Not strictly necessary, but
++% we're using \pkg{hyperref}, and the poor link targets are annoying.
++% \begin{macrocode}
++\RequirePackage[all]{hypcap}
++% \end{macrocode}
++% \Lopt{all} redefines the figure and table environments to
++% place the anchor at the start of the float.
++%
+ %
% \subsection{\cls{book} overrides and extensions}
%
% Here we change the behavior of a bunch of macros and environments from