[tex4ht-commits] [SCM] tex4ht updated: r1126 - trunk/lit

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Mon May 2 14:16:19 CEST 2022


Author: michal_h21
Date: 2022-05-02 12:16:19 +0000 (Mon, 02 May 2022)
New Revision: 1126

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-4ht.tex
Log:
Fixed support for links to cut files in xr

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2022-05-01 15:26:13 UTC (rev 1125)
+++ trunk/lit/ChangeLog	2022-05-02 12:16:19 UTC (rev 1126)
@@ -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/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2022-05-01 15:26:13 UTC (rev 1125)
+++ trunk/lit/tex4ht-4ht.tex	2022-05-02 12:16:19 UTC (rev 1126)
@@ -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
+    \input #1.xref% load saved cross-references
+    \endgroup
+}
+
+\ExplSyntaxOff
+>>>
+
 %%%%%%%%%%%%%%%%%%
 \Section{eso-pic}
 %%%%%%%%%%%%%%%%%%



More information about the tex4ht-commits mailing list.