Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt the counter redefinitions to the changes in the next release #358

Merged
merged 5 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Version: 2024-10-14 v7.01k

2024-10-14 Ulrike Fischer
* hyperref.dtx: adapt to new format (predefined \theHcounter, sockets)

2024-10-12 Ulrike Fischer
* hyperref.dtx: avoid warning if theHfootnote is predefined.

2024-08-31 Ulrike Fischer
* hyperref-linktarget.dtx: correct a test, see test missing-theH

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# README for hyperref bundle

Version 2024-07-10 v7.01j
Version 2024-10-12 v7.01k

## INTRODUCTION

Expand Down
2 changes: 1 addition & 1 deletion doc/hyperref-doc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
}
\makeatother
\title{Hypertext marks in \hologo{LaTeX}: a manual for \xpackage{hyperref}}
\date{2024-07-10 v7.01j}
\date{2024-10-12 v7.01k}

\begin{document}

Expand Down
4 changes: 2 additions & 2 deletions hluatex.dtx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% \iffalse
% Source File: hluatex.dtx
% 2024-07-10 v7.01j
% 2024-10-12 v7.01k
%
% Copyright
% 2016-2019 Oberdiek Package Support Group
Expand Down Expand Up @@ -31,7 +31,7 @@
%
% \begin{macrocode}
%<*luatex>
%% 2024-07-10 v7.01j
%% 2024-10-12 v7.01k
%% force unicode encoding, see issue #101
%% code mostly copied from hxetex.def
\HyPsd@LoadUnicode
Expand Down
2 changes: 1 addition & 1 deletion hyperref-linktarget.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
% }^^A
% }
%
% \date{Version 2024-07-10 v7.01j}
% \date{Version 2024-10-12 v7.01k}
%
% \maketitle
% \begin{documentation}
Expand Down
2 changes: 1 addition & 1 deletion hyperref-patches.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
% }^^A
% }
%
% \date{Version 2024-07-10 v7.01j}
% \date{Version 2024-10-12 v7.01k}
%
% \maketitle
% \begin{documentation}
Expand Down
141 changes: 96 additions & 45 deletions hyperref.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
%<puvnenc>\ProvidesFile{puvnenc.def}
%<puarenc>\ProvidesFile{puarenc.def}
%<psdextra>\ProvidesFile{psdextra.def}
%<!none&!packageEnd> [2024-07-10 v7.01j %
%<!none&!packageEnd> [2024-10-12 v7.01k %
%<package> Hypertext links for LaTeX]
%<nohyperref> Dummy hyperref (SR)]
%<driver> Hyperref documentation driver file]
Expand Down Expand Up @@ -10293,29 +10293,35 @@
\fi
\fi
}
\Hy@CounterExists{section}{%
\providecommand\theHequation{\theHsection.\arabic{equation}}%
}
\providecommand\theHequation{\arabic{equation}}%
\Hy@CounterExists{part}{%
\providecommand\theHpart{\arabic{part}}%
}
\@ifundefined{thechapter}{%
\providecommand\theHsection {\arabic{section}}%
\providecommand\theHfigure {\arabic{figure}}%
\providecommand\theHtable {\arabic{table}}%
}{%
\providecommand\theHchapter {\arabic{chapter}}%
\providecommand\theHfigure {\theHchapter.\arabic{figure}}%
\providecommand\theHtable {\theHchapter.\arabic{table}}%
\providecommand\theHsection {\theHchapter.\arabic{section}}%
}
\providecommand\theHsubsection {\theHsection.\arabic{subsection}}
\providecommand\theHsubsubsection{\theHsubsection.\arabic{subsubsection}}
\providecommand\theHparagraph {\theHsubsubsection.\arabic{paragraph}}
\providecommand\theHsubparagraph {\theHparagraph.\arabic{subparagraph}}
\providecommand\theHtheorem {\theHsection.\arabic{theorem}}
\providecommand\theHthm {\theHsection.\arabic{thm}}
% \end{macrocode}
% change 2024-10-13: do not define if format is new enough.
% \begin{macrocode}
\IfFormatAtLeastTF{2024-11-01}{}
{
\Hy@CounterExists{section}{%
\providecommand\theHequation{\theHsection.\arabic{equation}}%
}
\providecommand\theHequation{\arabic{equation}}%
\Hy@CounterExists{part}{%
\providecommand\theHpart{\arabic{part}}%
}
\@ifundefined{thechapter}{%
\providecommand\theHsection {\arabic{section}}%
\providecommand\theHfigure {\arabic{figure}}%
\providecommand\theHtable {\arabic{table}}%
}{%
\providecommand\theHchapter {\arabic{chapter}}%
\providecommand\theHfigure {\theHchapter.\arabic{figure}}%
\providecommand\theHtable {\theHchapter.\arabic{table}}%
\providecommand\theHsection {\theHchapter.\arabic{section}}%
}
\providecommand\theHsubsection {\theHsection.\arabic{subsection}}
\providecommand\theHsubsubsection{\theHsubsection.\arabic{subsubsection}}
\providecommand\theHparagraph {\theHsubsubsection.\arabic{paragraph}}
\providecommand\theHsubparagraph {\theHparagraph.\arabic{subparagraph}}
\providecommand\theHtheorem {\theHsection.\arabic{theorem}}
\providecommand\theHthm {\theHsection.\arabic{thm}}
}
% \end{macrocode}
% Thanks to Greta Meyer ([email protected]) for making me realize
% that enumeration starts at 0 for every list! But |\item|
Expand All @@ -10324,7 +10330,8 @@
% \begin{macrocode}
\let\H@item\item
\newcounter{Item}
\def\theHItem{\arabic{Item}}
\IfFormatAtLeastTF{2024-11-01}{}
{\def\theHItem{\arabic{Item}}}
\def\item{%
\@hyper@itemfalse
\if@nmbrlist\@hyper@itemtrue\fi
Expand All @@ -10333,23 +10340,23 @@
% \end{macrocode}
%
% \begin{macrocode}
\providecommand\theHenumi {\theHItem}
\providecommand\theHenumii {\theHItem}
\providecommand\theHenumiii {\theHItem}
\providecommand\theHenumiv {\theHItem}
\providecommand\theHHfootnote {\arabic{Hfootnote}}
\providecommand\theHmpfootnote{\arabic{mpfootnote}}
\@ifundefined{theHHmpfootnote}{%
\let\theHHmpfootnote\theHHfootnote
}{}
\IfFormatAtLeastTF{2024-11-01}{}
{
\providecommand\theHenumi {\theHItem}
\providecommand\theHenumii {\theHItem}
\providecommand\theHenumiii {\theHItem}
\providecommand\theHenumiv {\theHItem}
\providecommand\theHHfootnote {\arabic{Hfootnote}}
\providecommand\theHmpfootnote{\arabic{mpfootnote}}
}
% \end{macrocode}
% Tanmoy asked for this default handling of undefined |\theH<name>|
% situations. It really isn't clear what would be ideal, whether to
% turn off hyperizing of unknown elements, to pick up the textual
% definition of the counter, or to default it to something like
% |\arabic{name}|. We take the latter course, slightly worriedly.
% \begin{macrocode}
\let\H@refstepcounter\refstepcounter
\let\H@refstepcounter\@kernel@refstepcounter
\edef\name@of@eq{equation}%
% \end{macrocode}
% We do not want the handler for |\refstepcounter| to cut in
Expand All @@ -10366,11 +10373,13 @@
\@hyper@itemfalse
\@skiphyperreffalse
\ExplSyntaxOn
\def\refstepcounter#1{%
\legacy_if:nF {Hy@pdfstring}
{
\H@refstepcounter{#1}%
\bool_lazy_and:nnT
\IfFormatAtLeastTF{2024-11-01}
{
\NewSocketPlug{refstepcounter}{hyperref}{\ifHy@pdfstring\else#1\fi}
\AssignSocketPlug{refstepcounter}{hyperref}
\NewSocketPlug{refstepcounter/target}{hyperref}
{
\bool_lazy_and:nnT
{ \l__hyp_target_create_bool }
{ ! \legacy_if_p:n{@skiphyperref} }
{
Expand All @@ -10381,11 +10390,34 @@
\@hyper@itemfalse
}
{
\hyper@refstepcounter{#1}%
\hyper@refstepcounter{\@currentcounter}%
}
}
}
}
}
}
\AssignSocketPlug{refstepcounter/target}{hyperref}
}
{
\def\refstepcounter#1{%
\legacy_if:nF {Hy@pdfstring}
{
\H@refstepcounter{#1}%
\bool_lazy_and:nnT
{ \l__hyp_target_create_bool }
{ ! \legacy_if_p:n{@skiphyperref} }
{
\legacy_if:nTF {@hyper@item}
{
\stepcounter{Item}%
\hyper@refstepcounter{Item}%
\@hyper@itemfalse
}
{
\hyper@refstepcounter{#1}%
}
}
}
}
}
\ExplSyntaxOff
\let\Hy@saved@refstepcounter\refstepcounter
% \end{macrocode}
Expand Down Expand Up @@ -11031,7 +11063,19 @@
% \begin{macrocode}
\@ifundefined{hyper@nopatch@footnote}{%
\ifHy@hyperfootnotes
\newcounter{Hfootnote}%
\@ifundefined{theHfootnote}
{\newcounter{Hfootnote}}
{\let\H@@theHfootnote\theHfootnote
\let\theHfootnote\undefined
\newcounter{Hfootnote}
\let\theHfootnote\H@@theHfootnote
}%
% \end{macrocode}
% where is this used?
% \begin{macrocode}
\@ifundefined{theHHmpfootnote}{%
\let\theHHmpfootnote\theHHfootnote
}{}
\let\H@@footnotetext\@footnotetext
\let\H@@footnotemark\@footnotemark
\def\@xfootnotenext[#1]{%
Expand Down Expand Up @@ -11383,6 +11427,11 @@
}%
#3%
\fi
% \end{macrocode}
% as the anchor are set manually here, we have to update the tagging info.
% For now we test for the format but this should go again in 2025.
% \begin{macrocode}
\IfFormatAtLeastTF{2024-11-01}{\UseTaggingSocket{recordtarget}}{}%
}%
\fi
\par
Expand Down Expand Up @@ -12017,7 +12066,9 @@
% new counters are defined.
% change 2024-02-14: use a csname to handle counter names with commands,
% see issue \#330
% change 2024-10-13: disable patches in new format 2024-11-01.
% \begin{macrocode}
\IfFormatAtLeastTF{2024-11-01}{\def\hyper@nopatch@counter{}}{}
\@ifundefined{hyper@nopatch@counter}
{
\let\H@definecounter\@definecounter
Expand Down
2 changes: 1 addition & 1 deletion testfiles-pdftex/patch.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ l. ...\ShowCommand\@footnotetext
<argument> \caption
l. ...\ShowCommand\caption
> \@caption=\long macro:
#1[#2]#3->\expandafter \ifx \csname if@capstart\expandafter \endcsname \csname iftrue\endcsname \global \let \@currentHref \hc@currentHref \else \hyper@makecurrent {\@captype }\fi \@ifundefined {NR@gettitle}{\def \@currentlabelname {#2}}{\NR@gettitle {#2}}\par \addcontentsline {\csname ext@#1\endcsname }{#1}{\protect \numberline {\csname the#1\endcsname }{\ignorespaces #2}}\begingroup \@parboxrestore \if@minipage \@setminipage \fi \normalsize \expandafter \ifx \csname if@capstart\expandafter \endcsname \csname iftrue\endcsname \global \@capstartfalse \@makecaption {\csname fnum@#1\endcsname }{\ignorespaces #3}\else \@makecaption {\csname fnum@#1\endcsname }{\ignorespaces \ifHy@nesting \expandafter \hyper@@anchor \expandafter {\@currentHref }{#3}\else \Hy@raisedlink {\expandafter \hyper@@anchor \expandafter {\@currentHref }{\relax }}#3\fi }\fi \par \endgroup .
#1[#2]#3->\expandafter \ifx \csname if@capstart\expandafter \endcsname \csname iftrue\endcsname \global \let \@currentHref \hc@currentHref \else \hyper@makecurrent {\@captype }\fi \@ifundefined {NR@gettitle}{\def \@currentlabelname {#2}}{\NR@gettitle {#2}}\par \addcontentsline {\csname ext@#1\endcsname }{#1}{\protect \numberline {\csname the#1\endcsname }{\ignorespaces #2}}\begingroup \@parboxrestore \if@minipage \@setminipage \fi \normalsize \expandafter \ifx \csname if@capstart\expandafter \endcsname \csname iftrue\endcsname \global \@capstartfalse \@makecaption {\csname fnum@#1\endcsname }{\ignorespaces #3}\else \@makecaption {\csname fnum@#1\endcsname }{\ignorespaces \ifHy@nesting \expandafter \hyper@@anchor \expandafter {\@currentHref }{#3}\else \Hy@raisedlink {\expandafter \hyper@@anchor \expandafter {\@currentHref }{\relax }}#3\fi \IfFormatAtLeastTF {....-..-..}{\UseTaggingSocket {recordtarget}}{}}\fi \par \endgroup .
<argument> \@caption
l. ...\ShowCommand\@caption
> \addcontentsline=macro:
Expand Down
2 changes: 1 addition & 1 deletion xr-hyper.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
%
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{xr-hyper}
%<package> [2024-07-10 v7.01j eXternal References (DPC)]
%<package> [2024-10-12 v7.01k eXternal References (DPC)]
%
%<*driver>
\documentclass{l3doc}
Expand Down