From 104c41347f9b99853cfb5c5b9e56d59e8bc40af6 Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 17 Oct 2023 18:29:52 -0700 Subject: [PATCH] Added hyperref --- resources/ormc_handout.cls | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/resources/ormc_handout.cls b/resources/ormc_handout.cls index 8ea8750..139a1a7 100755 --- a/resources/ormc_handout.cls +++ b/resources/ormc_handout.cls @@ -320,6 +320,7 @@ \RequirePackage{tikz} % Used by \boxlinehack \RequirePackage{comment} % Used to hide solutions \RequirePackage{tcolorbox} % For solution boxes +\RequirePackage{hyperref} % For custom references & clickable links \tcbuselibrary{breakable} % Allows tcolorboxes to break across pages \RequirePackage[ % Provides \say{} for quoted text. @@ -408,7 +409,8 @@ \end{tcolorbox} } -\newcommand{\maketitle}{ +% hyperref already defines maketitle. +\renewcommand{\maketitle}{ \begingroup \centering \begin{minipage}{0.7\textwidth} @@ -458,23 +460,25 @@ % and its second arg takes two parts without hyperref and four with it. \newcommand{\@customlabel}[2]{% \@ifpackageloaded{hyperref}{% + \@bsphack \begingroup - \def\label@name{#1}% - \def\@currentlabel{#2}% - \label@hook - \protected@write\@auxout{}{% - \string\newlabel{#1}{% - {\@currentlabel}% - {\thepage}% - {\@currentlabelname}% - {\@currentHref}% - {}% + \def\label@name{#1}% + \def\@currentlabel{#2}% + \label@hook + \protected@write\@auxout{}{% + \string\newlabel{#1}{% + {\@currentlabel}% + {\thepage}% + {\@currentlabelname}% + {\@currentHref}% + {}% + }% }% - }% \endgroup + \@esphack }{ \protected@write\@auxout{}{\string\newlabel{#1}{{#2}{\thepage}}}% -} + } } @@ -488,7 +492,7 @@ {\bf\Large \hfill \IfNoValueTF{#2}{Unnamed Section}{#2} \hfill\null}% }{% {\bf\Large \hfill Part \arabic{section_counter}\IfNoValueF{#2}{: #2} \hfill\null}% - \IfNoValueF{#3}{\@customlabel{#3}Part \arabic{section_counter}}% + \IfNoValueF{#3}{\@customlabel{#3}{Part \arabic{section_counter}}}% } \\* \vspace{2mm} }