summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/tex4ht/xrhyper-hooks.4ht
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/tex4ht/xrhyper-hooks.4ht')
-rw-r--r--Master/texmf-dist/tex/generic/tex4ht/xrhyper-hooks.4ht29
1 files changed, 27 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/generic/tex4ht/xrhyper-hooks.4ht b/Master/texmf-dist/tex/generic/tex4ht/xrhyper-hooks.4ht
index ce6de61b579..aac2f48868f 100644
--- a/Master/texmf-dist/tex/generic/tex4ht/xrhyper-hooks.4ht
+++ b/Master/texmf-dist/tex/generic/tex4ht/xrhyper-hooks.4ht
@@ -1,4 +1,4 @@
-% xrhyper-hooks.4ht (2022-05-01-08:25), generated from tex4ht-4ht.tex
+% xrhyper-hooks.4ht (2022-05-02-13:15), generated from tex4ht-4ht.tex
% Copyright 2020 TeX Users Group
%
% This work may be distributed and/or modified under the
@@ -16,7 +16,31 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2022-05-01-08:25}
+\immediate\write-1{version 2022-05-02-13:15}
+
+\ExplSyntaxOn
+% detect )F[number]F- using l3regex
+\regex_new:N \l_xref_filename
+\regex_set:Nn \l_xref_filename {F\d+F}
+% save all filenames declared in the xref file
+\def\:extract:filename:from:xref#1#2#3{%
+ \regex_match:NnTF \l_xref_filename {#1}{%
+ \filename@parse{#2}
+ \expandafter\xdef\csname xr:dir:\filename@base\endcsname{\:tempa}
+}{}
+}
+\def\:declare:xref:files#1#2{
+ \begingroup
+ % we need to find filenames of cutfiles
+ % we will use \filename@parse again, so we need to save the directory name
+ \edef\:tempa{#2}%
+ \def\:CrossWord##1##2##3{\:extract:filename:from:xref{##1}{##2}{\:tempa}}%
+ \catcode`\:=11% : is not letter at this moment
+ \InputIfFileExists{#1.xref}{}{}% load saved cross-references
+ \endgroup
+}
+
+\ExplSyntaxOff
\:AtEndOfPackage{\let\XR:\XR@
\def\XR@[#1][#2]#3{%
@@ -24,6 +48,7 @@
\filename@parse{#3}%
% \filename@base is filename, \filename@area directory
\expandafter\xdef\csname xr:dir:\filename@base\endcsname{\filename@area}%
+ \:declare:xref:files{\filename@area\filename@base}{\filename@area}% declare directory for cut files
\AtBeginDocument{\XR:[#1][#2]{#3}}
}%
}