Debian Codegraph @

texmf-dist/tex/generic/tex4ht/xr-hyper.4ht

raw
1 % xr-hyper.4ht (2025-06-05-13:26), generated from tex4ht-4ht.tex
2 % Copyright 2003-2025 TeX Users Group
3 % Copyright 2009-2025 TeX Users Group
4 %
5 % This work may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either
7 % version 1.3c of this license or (at your option) any
8 % later version. The latest version of this license is in
9 % https://www.latex-project.org/lppl.txt
10 % and version 1.3c or later is part of all distributions
11 % of LaTeX version 2005/12/01 or later.
12 %
13 % This work has the LPPL maintenance status "maintained".
14 %
15 % The Current Maintainer of this work
16 % is the TeX4ht Project <https://tug.org/tex4ht>.
17 %
18 % If you modify this program, changing the
19 % version identification would be appreciated.
20 \immediate\write-1{version 2025-06-05-13:26}
21
22 \let\XR:loop=\XR@loop
23 \def\XR@loop#1{%
24 \def\:temp##1.aux{\openin15=##1.xref
25 \ifeof15
26 \:warning{missing ##1.xref for ##1.aux}%
27 \let\:temp\empty
28 \else
29 \def\:temp{\input ##1.xref}%
30 \fi
31 \closein15 \:temp
32 }%
33 \catcode`\:=11
34 \expandafter\ifx \csname xr:CrossWord\endcsname\relax
35 \let\xr:CrossWord=\Cross:Word
36 \def\Cross:Word##1##2{%
37 \expandafter\let\csname cw:\cw:format{##1##2}\endcsname\:UnDef
38 \xr:CrossWord{##1}{##2}}%
39 \fi
40 %
41 \:temp#1%
42 \catcode`\:=12
43 \XR:loop{#1}%
44 }
45 \ExplSyntaxOn
46 \long\def\XR@test#1#2#3#4\XR@{%
47 \ifx#1\newlabel
48 \regex_if_match:nnTF{@cref}{#2}% we must handle cleveref meta references
49 {\expandafter\xdef\csname r@\XR@prefix#2\endcsname{#3}}%
50 {\expandafter\xdef\csname r@\XR@prefix#2\endcsname{\XR:rEfLiNK #3}}%
51 %
52 \else\ifx#1\@input
53 \edef\XR@list{\XR@list#2\relax}%
54 \fi\fi
55 \ifeof\@inputcheck\expandafter\XR@aux
56 \else\expandafter\XR@read\fi}
57 \ExplSyntaxOff
58
59 \def\XRrEfLiNK[#1]#2#3{%
60 \filename@parse{#1}% Get basename of the linked html file,
61 % xr:dir\filename@base contains file's directory
62 \a:xr[\csname xr:dir:\filename@base\endcsname#1]{#2}{}%
63 \ifx\hyperrefLabel\:UnDef #3\else \hyperrefLabel\fi \b:xr}
64 \NewConfigure{xr}{2}
65 \Configure{xr}{\Link}{\EndLink}
66 \def\XR:rEfLiNK#1#2#3#4#5{{\xr:rEfLiNK#1}{\xr:rEfLiNK#2}{\xr:rEfLiNK#3}}
67 \def\xr:rEfLiNK#1#2{\noexpand\XRrEfLiNK[\Get:HFile#2-]{#2}}
68 \def\Get:HFile#1-#2-{\:LikeRef{)F\:gobble #1F-}}
69
70 \Hinput{xr}
71 \endinput
72