summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-05-02 20:41:31 +0000
committerKarl Berry <karl@freefriends.org>2022-05-02 20:41:31 +0000
commit957584b19caf7f9a88318af52e7c75360a665af0 (patch)
treeabc348701a30682da16c56c8a81f66d1a3f61afe
parent72582827168a64968833d01417cc1af5186b0f41 (diff)
links to cut files in xr, tex4ht r1126; conditional include of .xref, tex4ht r1127
git-svn-id: svn://tug.org/texlive/trunk@63211 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/ChangeLog6
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex34
-rw-r--r--Master/texmf-dist/tex/generic/tex4ht/xr-hooks.4ht29
-rw-r--r--Master/texmf-dist/tex/generic/tex4ht/xrhyper-hooks.4ht29
4 files changed, 93 insertions, 5 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
index a8924e8b5f5..4bdb6320c77 100644
--- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog
+++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
@@ -1,3 +1,9 @@
+2022-05-02 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (xrhyper-hooks.4ht, xr-hooks.4ht): fixed support
+ for the cut files.
+ https://puszcza.gnu.org.ua/bugs/?561
+
2022-05-01 Karl Berry <karl@freefriends.org>
* tex4ht-4ht.tex,
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
index f4b07a72b81..ac3a2f55863 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1125 2022-05-01 15:26:13Z karl $
+% $Id: tex4ht-4ht.tex 1127 2022-05-02 12:43:55Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2022 TeX Users Group
@@ -3793,6 +3793,7 @@ before \''\begin{document}'.
% xr-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht copywrite|>
+|<xr cut files|>
|<wait with xr|>
>>>\AddFile{7}{xr-hooks}
@@ -3803,6 +3804,7 @@ before \''\begin{document}'.
\filename@parse{#2}%
% \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
\Configure{AtBeginDocument}{\XR:[#1]{#2}}{}}%
}
>>>
@@ -3917,6 +3919,7 @@ Hyperref pasess five arguments to \`|\newlabel|, we must adapt \`|\XR:rEfLiNK| t
% xrhyper-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht license text|>
+|<xr cut files|>
|<wait with xr-hyper|>
>>> \AddFile{9}{xrhyper-hooks}
@@ -3931,11 +3934,40 @@ it, so we can safely eat that.
\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}}
}%
}
>>>
+Declare file directory for filtes that were cut from the main file (using options "3", "4", etc.)
+
+\<xr cut files\><<<
+\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
+>>>
+
%%%%%%%%%%%%%%%%%%
\Section{eso-pic}
%%%%%%%%%%%%%%%%%%
diff --git a/Master/texmf-dist/tex/generic/tex4ht/xr-hooks.4ht b/Master/texmf-dist/tex/generic/tex4ht/xr-hooks.4ht
index 9db247c22ee..e38a72ffbc3 100644
--- a/Master/texmf-dist/tex/generic/tex4ht/xr-hooks.4ht
+++ b/Master/texmf-dist/tex/generic/tex4ht/xr-hooks.4ht
@@ -1,4 +1,4 @@
-% xr-hooks.4ht (2022-04-26-14:00), generated from tex4ht-4ht.tex
+% xr-hooks.4ht (2022-05-02-13:15), generated from tex4ht-4ht.tex
% Copyright 2020 TeX Users Group
% Copyright 2009-2022 TeX Users Group
%
@@ -17,7 +17,31 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2022-04-26-14:00}
+\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{%
@@ -25,6 +49,7 @@
\filename@parse{#2}%
% \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
\Configure{AtBeginDocument}{\XR:[#1]{#2}}{}}%
}
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}}
}%
}