Fixed hyperref support

This commit is contained in:
Mark 2023-07-19 09:54:30 -07:00
parent 82d2f13f0f
commit d238f12f69
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4

View File

@ -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}