texlive[63211] Master/texmf-dist: links to cut files in xr, tex4ht
commits+karl at tug.org
commits+karl at tug.org
Mon May 2 22:41:31 CEST 2022
Revision: 63211
http://tug.org/svn/texlive?view=revision&revision=63211
Author: karl
Date: 2022-05-02 22:41:31 +0200 (Mon, 02 May 2022)
Log Message:
-----------
links to cut files in xr, tex4ht r1126; conditional include of .xref, tex4ht r1127
Revision Links:
--------------
http://tug.org/svn/texlive?view=revision&revision=1126
http://tug.org/svn/texlive?view=revision&revision=1127
Modified Paths:
--------------
trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
trunk/Master/texmf-dist/tex/generic/tex4ht/xr-hooks.4ht
trunk/Master/texmf-dist/tex/generic/tex4ht/xrhyper-hooks.4ht
Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog 2022-05-02 19:57:54 UTC (rev 63210)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog 2022-05-02 20:41:31 UTC (rev 63211)
@@ -1,3 +1,9 @@
+2022-05-02 Michal Hoftich <michal.h21 at 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 at freefriends.org>
* tex4ht-4ht.tex,
Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex 2022-05-02 19:57:54 UTC (rev 63210)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex 2022-05-02 20:41:31 UTC (rev 63211)
@@ -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 @@
% 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 @@
\filename at parse{#2}%
% \filename at base is filename, \filename at area directory
\expandafter\xdef\csname xr:dir:\filename at base\endcsname{\filename at area}%
+ \:declare:xref:files{\filename at area\filename at base}{\filename at area}% declare directory for cut files
\Configure{AtBeginDocument}{\XR:[#1]{#2}}{}}%
}
>>>
@@ -3917,6 +3919,7 @@
% 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 @@
\filename at parse{#3}%
% \filename at base is filename, \filename at area directory
\expandafter\xdef\csname xr:dir:\filename at base\endcsname{\filename at area}%
+ \:declare:xref:files{\filename at area\filename at base}{\filename at 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 at parse{#2}
+ \expandafter\xdef\csname xr:dir:\filename at base\endcsname{\:tempa}
+}{}
+}
+\def\:declare:xref:files#1#2{
+ \begingroup
+ % we need to find filenames of cutfiles
+ % we will use \filename at 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}
%%%%%%%%%%%%%%%%%%
Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/xr-hooks.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/xr-hooks.4ht 2022-05-02 19:57:54 UTC (rev 63210)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/xr-hooks.4ht 2022-05-02 20:41:31 UTC (rev 63211)
@@ -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,8 +17,32 @@
%
% 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 at parse{#2}
+ \expandafter\xdef\csname xr:dir:\filename at base\endcsname{\:tempa}
+}{}
+}
+\def\:declare:xref:files#1#2{
+ \begingroup
+ % we need to find filenames of cutfiles
+ % we will use \filename at 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{%
% save directory for the linked file
@@ -25,6 +49,7 @@
\filename at parse{#2}%
% \filename at base is filename, \filename at area directory
\expandafter\xdef\csname xr:dir:\filename at base\endcsname{\filename at area}%
+ \:declare:xref:files{\filename at area\filename at base}{\filename at area}% declare directory for cut files
\Configure{AtBeginDocument}{\XR:[#1]{#2}}{}}%
}
Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/xrhyper-hooks.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/xrhyper-hooks.4ht 2022-05-02 19:57:54 UTC (rev 63210)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/xrhyper-hooks.4ht 2022-05-02 20:41:31 UTC (rev 63211)
@@ -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,8 +16,32 @@
%
% 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 at parse{#2}
+ \expandafter\xdef\csname xr:dir:\filename at base\endcsname{\:tempa}
+}{}
+}
+\def\:declare:xref:files#1#2{
+ \begingroup
+ % we need to find filenames of cutfiles
+ % we will use \filename at 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{%
% save directory for the linked file
@@ -24,6 +48,7 @@
\filename at parse{#3}%
% \filename at base is filename, \filename at area directory
\expandafter\xdef\csname xr:dir:\filename at base\endcsname{\filename at area}%
+ \:declare:xref:files{\filename at area\filename at base}{\filename at area}% declare directory for cut files
\AtBeginDocument{\XR:[#1][#2]{#3}}
}%
}
More information about the tex-live-commits
mailing list.