texlive[66530] Master/texmf-dist: cleveref/xr clash, tex4ht r1305

commits+karl at tug.org commits+karl at tug.org
Fri Mar 10 23:36:37 CET 2023


Revision: 66530
          http://tug.org/svn/texlive?view=revision&revision=66530
Author:   karl
Date:     2023-03-10 23:36:37 +0100 (Fri, 10 Mar 2023)
Log Message:
-----------
cleveref/xr clash, tex4ht r1305

Revision Links:
--------------
    http://tug.org/svn/texlive?view=revision&revision=1305

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/cleveref.4ht
    trunk/Master/texmf-dist/tex/generic/tex4ht/xr-hyper.4ht
    trunk/Master/texmf-dist/tex/generic/tex4ht/xr.4ht

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2023-03-10 22:34:34 UTC (rev 66529)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2023-03-10 22:36:37 UTC (rev 66530)
@@ -1,3 +1,10 @@
+2023-03-10  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (xr.4ht,  xr-hyper.4ht, cleveref.4ht): fixed clash
+	between Cleveref and Xr.
+	https://github.com/michal-h21/make4ht/issues/113
+	https://tex.stackexchange.com/q/678730/2891
+
 2023-03-07  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-4ht.tex (physics.4ht): fixed MathML issues with the Physics

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex	2023-03-10 22:34:34 UTC (rev 66529)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex	2023-03-10 22:36:37 UTC (rev 66530)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1304 2023-03-07 12:50:09Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1305 2023-03-10 16:01:24Z michal_h21 $
 % tex tex4ht-4ht   or   ht tex tex4ht-4ht
 %
 % Copyright 2009-2023 TeX Users Group    
@@ -3631,7 +3631,7 @@
 
 \<cleveref.4ht\><<<
 % cleveref.4ht (|version), generated from |jobname.tex
-% Copyright 2018-2022 TeX Users Group
+% Copyright 2018-2023 TeX Users Group
 |<TeX4ht license text|>
 
 |<cleveref refstepcounter|>
@@ -3692,6 +3692,7 @@
 \fi
 \def\:tempa#1#2{\bgroup%
   \def\rEfLiNK##1##2{\Link{##1}{}}%
+  \def\XRrEfLiNK[##1]##2##3{\Link[##1]{##2}{}}% handle links from Xr and Xr-hyper
   \expandafter\expandafter\expandafter\@firstoffive\csname r@#2\endcsname{}{}{}{}{}%
   \cref at getlabel{#2}{\@templabel}%
   #1{\@templabel}{}{}%
@@ -3845,7 +3846,7 @@
 
 \<xr.4ht\><<<
 % xr.4ht (|version), generated from |jobname.tex
-% Copyright |CopyYear.1997. Eitan M. Gurari
+% Copyright 1997-2023 TeX Users Group
 |<TeX4ht copywrite|>
    |<fix xr|>
    |<fix xr-nonhyper|>
@@ -3933,11 +3934,17 @@
 \`'-'. The if acts on \`')F1F-' to get the file name. Where the \`'x'
 got into the picture? Did \''\aXrefFile' introduced it? where? 
 
+We must also test for references with the @cref suffix - these are automatically
+created by Cleveref and contain meta info about reference types.
+
 \<xr newlabel\><<<
-\expandafter\xdef\csname r@\XR at prefix#2\endcsname{\XR:rEfLiNK #3}%
+\regex_match:nnTF{@cref}{#2}% we must handle cleveref meta references
+{\expandafter\xdef\csname r@\XR at prefix#2\endcsname{#3}}%
+{\expandafter\xdef\csname r@\XR at prefix#2\endcsname{\XR:rEfLiNK #3}}%
 >>>
 
 \<fix xr\><<<
+\ExplSyntaxOn
 \long\def\XR at test#1#2#3#4\XR@{%
   \ifx#1\newlabel
      |<xr newlabel|>%
@@ -3946,6 +3953,7 @@
   \fi\fi
   \ifeof\@inputcheck\expandafter\XR at aux
   \else\expandafter\XR at read\fi}
+\ExplSyntaxOff
 >>>
 
 %%%%%%%%%%%%%%%%%%%%%
@@ -3954,7 +3962,7 @@
 
 \<xr-hyper.4ht\><<<
 % xr-hyper.4ht (|version), generated from |jobname.tex
-% Copyright |CopyYear.2003. Eitan M. Gurari     
+% Copyright 2003-2023 TeX Users Group
 |<TeX4ht copywrite|>
    |<fix xr|>
    |<fix xr-hyper|>

Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/cleveref.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/cleveref.4ht	2023-03-10 22:34:34 UTC (rev 66529)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/cleveref.4ht	2023-03-10 22:36:37 UTC (rev 66530)
@@ -1,5 +1,5 @@
-% cleveref.4ht (2022-11-04-13:31), generated from tex4ht-4ht.tex
-% Copyright 2018-2022 TeX Users Group
+% cleveref.4ht (2023-03-10-14:19), generated from tex4ht-4ht.tex
+% Copyright 2018-2023 TeX Users Group
 %
 % This work may be distributed and/or modified under the
 % conditions of the LaTeX Project Public License, either
@@ -16,7 +16,7 @@
 %
 % If you modify this program, changing the
 % version identification would be appreciated.
-\immediate\write-1{version 2022-11-04-13:31}
+\immediate\write-1{version 2023-03-10-14:19}
 
 
 
@@ -62,6 +62,7 @@
 \fi
 \def\:tempa#1#2{\bgroup%
   \def\rEfLiNK##1##2{\Link{##1}{}}%
+  \def\XRrEfLiNK[##1]##2##3{\Link[##1]{##2}{}}% handle links from Xr and Xr-hyper
   \expandafter\expandafter\expandafter\@firstoffive\csname r@#2\endcsname{}{}{}{}{}%
   \cref at getlabel{#2}{\@templabel}%
   #1{\@templabel}{}{}%

Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/xr-hyper.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/xr-hyper.4ht	2023-03-10 22:34:34 UTC (rev 66529)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/xr-hyper.4ht	2023-03-10 22:36:37 UTC (rev 66530)
@@ -1,6 +1,6 @@
-% xr-hyper.4ht (2022-05-23-13:42), generated from tex4ht-4ht.tex
-% Copyright 2003-2009 Eitan M. Gurari
-% Copyright 2009-2022 TeX Users Group
+% xr-hyper.4ht (2023-03-10-14:19), generated from tex4ht-4ht.tex
+% Copyright 2003-2023 TeX Users Group
+% Copyright 2009-2023 TeX Users Group
 %
 % This work may be distributed and/or modified under the
 % conditions of the LaTeX Project Public License, either
@@ -17,7 +17,7 @@
 %
 % If you modify this program, changing the
 % version identification would be appreciated.
-\immediate\write-1{version 2022-05-23-13:42}
+\immediate\write-1{version 2023-03-10-14:19}
 
    \let\XR:loop=\XR at loop
 \def\XR at loop#1{%
@@ -42,9 +42,12 @@
    \catcode`\:=12
    \XR:loop{#1}%
 }
+\ExplSyntaxOn
 \long\def\XR at test#1#2#3#4\XR@{%
   \ifx#1\newlabel
-     \expandafter\xdef\csname r@\XR at prefix#2\endcsname{\XR:rEfLiNK #3}%
+     \regex_match:nnTF{@cref}{#2}% we must handle cleveref meta references
+{\expandafter\xdef\csname r@\XR at prefix#2\endcsname{#3}}%
+{\expandafter\xdef\csname r@\XR at prefix#2\endcsname{\XR:rEfLiNK #3}}%
 %
   \else\ifx#1\@input
      \edef\XR at list{\XR at list#2\relax}%
@@ -51,6 +54,7 @@
   \fi\fi
   \ifeof\@inputcheck\expandafter\XR at aux
   \else\expandafter\XR at read\fi}
+\ExplSyntaxOff
 
    \def\XRrEfLiNK[#1]#2#3{%
   \filename at parse{#1}% Get basename of the linked html file,

Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/xr.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/xr.4ht	2023-03-10 22:34:34 UTC (rev 66529)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/xr.4ht	2023-03-10 22:36:37 UTC (rev 66530)
@@ -1,6 +1,6 @@
-% xr.4ht (2022-04-26-14:00), generated from tex4ht-4ht.tex
-% Copyright 1997-2009 Eitan M. Gurari
-% Copyright 2009-2022 TeX Users Group
+% xr.4ht (2023-03-10-14:19), generated from tex4ht-4ht.tex
+% Copyright 1997-2023 TeX Users Group
+% Copyright 2009-2023 TeX Users Group
 %
 % This work may be distributed and/or modified under the
 % conditions of the LaTeX Project Public License, either
@@ -17,7 +17,7 @@
 %
 % 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 2023-03-10-14:19}
 
    \let\XR:loop=\XR at loop
 \def\XR at loop#1{%
@@ -42,9 +42,12 @@
    \catcode`\:=12
    \XR:loop{#1}%
 }
+\ExplSyntaxOn
 \long\def\XR at test#1#2#3#4\XR@{%
   \ifx#1\newlabel
-     \expandafter\xdef\csname r@\XR at prefix#2\endcsname{\XR:rEfLiNK #3}%
+     \regex_match:nnTF{@cref}{#2}% we must handle cleveref meta references
+{\expandafter\xdef\csname r@\XR at prefix#2\endcsname{#3}}%
+{\expandafter\xdef\csname r@\XR at prefix#2\endcsname{\XR:rEfLiNK #3}}%
 %
   \else\ifx#1\@input
      \edef\XR at list{\XR at list#2\relax}%
@@ -51,6 +54,7 @@
   \fi\fi
   \ifeof\@inputcheck\expandafter\XR at aux
   \else\expandafter\XR at read\fi}
+\ExplSyntaxOff
 
    \def\XRrEfLiNK[#1]#2#3{%
   \filename at parse{#1}% Get basename of the linked html file,



More information about the tex-live-commits mailing list.