[latex3-commits] [latex3/hyperref] newlabel: simpler ... (1b743eb)
github at latex-project.org
github at latex-project.org
Sun May 14 01:04:08 CEST 2023
Repository : https://github.com/latex3/hyperref
On branch : newlabel
Link : https://github.com/latex3/hyperref/commit/1b743eb5420b83ae1d0a8339dc455acc5f9c3a56
>---------------------------------------------------------------
commit 1b743eb5420b83ae1d0a8339dc455acc5f9c3a56
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sun May 14 01:04:08 2023 +0200
simpler ...
>---------------------------------------------------------------
1b743eb5420b83ae1d0a8339dc455acc5f9c3a56
build.lua | 2 +-
hyperref.dtx | 23 +++++------------------
xr-hyper.sty | 30 ++++++------------------------
3 files changed, 12 insertions(+), 43 deletions(-)
diff --git a/build.lua b/build.lua
index f6b6d95..34ea2ee 100644
--- a/build.lua
+++ b/build.lua
@@ -75,7 +75,7 @@ checkengines = {"pdftex","etex","luatex"}
-- for dev testing
-- checkengines = {"pdftex","pdftexdev","etex","luatex"}
--- checkengines = {"pdftexdev"}
+checkengines = {"pdftex","pdftexdev"}
-- temp settings disable checks while testing ctan build
-- testfiledir= "disabled"
diff --git a/hyperref.dtx b/hyperref.dtx
index 27a7d30..746d95a 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -4246,26 +4246,13 @@
% \end{macrocode}
%
% \subsection{Package xr and xr-hyper}
-% The beta version of xr that supports \cmd{\XR at addURL} is called
-% \verb|xr-hyper|. Therefore we test for the macro itself and not
-% for the package name:
-% \begin{macrocode}
-\ltx at IfUndefined{XR at addURL}{%
-}{%
-% \end{macrocode}
+%
+% The beta version of xr that supports \cmd{\XR at addURL} is called
+% \verb|xr-hyper|.
% If reading external aux files check whether they have a non zero
% fourth field in |\newlabel| and if so, add the URL as the fifth field.
-% \begin{macrocode}
- \def\XR at addURL#1{\XR@@dURL#1{}{}{}{}\\}%
- \def\XR@@dURL#1#2#3#4#5\\{%
- {#1}{#2}%
- \if!#4!%
- \else
- {#3}{#4}{\XR at URL}%
- \fi
- }%
-}
-% \end{macrocode}
+% Change 2023-05-14: xr-hyper adds the field.
+%
%
% \begin{macrocode}
\def\Hy at true{true}
diff --git a/xr-hyper.sty b/xr-hyper.sty
index c20cb27..79e3958 100644
--- a/xr-hyper.sty
+++ b/xr-hyper.sty
@@ -93,27 +93,10 @@
\long\def\@thirdofthree #1#2#3{#3}
% 2023-05-13 we need to handle \newlabel's with two arguments differently
-% to \newlabel's with three argument. For this we count the values of the first
-% \newlabel of an aux-file.
-% By default we assume five arguments as that will be the case in future LaTeX
-\ExplSyntaxOn
-\def\XR at HYPcompargs{}
-\newcommand\XR at testnewlabel[1]{}
-\cs_new_protected:Npn\XR at testnewlabel@aux #1
- {
- \cs_set_eq:NN \XR at testnewlabel \use_none:n
- \int_compare:nNnT{\tl_count:n{#1}}={2}
- {
- \def\XR at HYPcompargs{{}{}{}}
- }
- }
-\ExplSyntaxOff
-% we also have to ensure that hyperref doesn't remove the empty braces again
-% % or that \XR at HYPcompargs adds more
-\AddToHook{package/hyperref/after}
- {
- \def\XR at addURL#1\XR at HYPcompargs{\XR@@dURL#1{}{}{}{}\\}
- \def\XR@@dURL#1#2#3#4#5\\{%
+% to \newlabel's with five argument. For this we make use of
+% XR at addURL:
+\def\XR at addURL#1{\XR@@dURL#1{}{}{}{}\\}
+\def\XR@@dURL#1#2#3#4#5\\{%
{#1}{#2}%
\if!#4!%
{#3}{#4}{}% new perhaps this could use \XR at URL too?
@@ -121,7 +104,6 @@
{#3}{#4}{\XR at URL}%
\fi
}%
- }
\def\XR at explist{\expandafter\XR at next\XR at list\\}
\def\XR at loop#1{%
@@ -147,8 +129,8 @@
\let\XR at tempa\@thirdofthree
\fi\fi\fi
\XR at tempa
- {\XR at testnewlabel{#3}%
- \expandafter\protected at xdef\csname r@\XR at prefix#2\endcsname{\XR at addURL{#3}\XR at HYPcompargs}%
+ {%\XR at testnewlabel{#3}%
+ \expandafter\protected at xdef\csname r@\XR at prefix#2\endcsname{\XR at addURL{#3}}%
}%
{\expandafter\bibcite\expandafter{\XR at prefix#2}{#3}}%
{\edef\XR at list{\XR at list\filename at area#2\relax}}%
More information about the latex3-commits
mailing list.