diff --git a/resources/ormc_handout.cls b/resources/ormc_handout.cls index 9f95669..8c826f1 100755 --- a/resources/ormc_handout.cls +++ b/resources/ormc_handout.cls @@ -453,9 +453,30 @@ % Helper command that creates a label with custom text. % Args: label name, custom text +% +% newlabel is redefined by hyperref, +% and its second arg takes two parts without hyperref and four with it. \newcommand{\@customlabel}[2]{% - \protected@write\@auxout{}{\string\newlabel{#1}{{#2}{}}}% + \@ifpackageloaded{hyperref}{% + \begingroup + \def\label@name{#1}% + \def\@currentlabel{#2}% + \label@hook + \protected@write\@auxout{}{% + \string\newlabel{#1}{% + {\@currentlabel}% + {\thepage}% + {\@currentlabelname}% + {\@currentHref}% + {}% + }% + }% + \endgroup + }{ + \protected@write\@auxout{}{\string\newlabel{#1}{{#2}{\thepage}}}% } +} + % Starred sections are not numbered. \newcounter{section_counter}