Defines a command ‘\externaldocument’ for importing exterla aux files from foreugn sources. Should be called after \Preamble, and before \begin{document}.
<..xr.4ht..>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% xr.4ht 2014-07-12-22:36 %
% Copyright (C) 1997--2009 Eitan M. Gurari %
<.TeX4ht copyright.>
<.fix xr.>
\Hinput{xr}
\endinput
-_-_-
<..use package..>
xr,-_-_-
<..add to usepackage..>
\def\:temp{xr}\ifx \@currname\:temp
<.wait with xr.>
\fi
-_-_-
<..wait with xr..>
\AtEndOfPackage{\let\XR:\XR@
\def\XR@[#1]#2{%
\Configure{AtBeginDocument}{\XR:[#1]{#2}}{}}%
}
-_-_-
<..fix xr..>
\let\XR:loop=\XR@loop
\def\XR@loop#1{%
\def\:temp##1.aux{<.load xref of aux.>}%
\catcode‘\:=11
<.xref for xr.>%
\:temp#1%
\catcode‘\:=12
\XR:loop{#1}%
}
-_-_-
<..load xref of aux..>
\openin15=##1.xref
\ifeof15
\:warning{missing ##1.xref for ##1.aux}%
\let\:temp\empty
\else
\def\:temp{\input ##1.xref}%
\fi
\closein15 \:temp
-_-_-
<..xref for xr..>
\expandafter\ifx \csname xr:CrossWord\endcsname\relax
\let\xr:CrossWord=\Cross:Word
\def\Cross:Word##1##2{%
\expandafter\let\csname cw:\cw:format{##1##2}\endcsname\:UnDef
\xr:CrossWord{##1}{##2}}%
\fi
-_-_-
<..fix xr..>+
\def\XRrEfLiNK[#1]#2#3{\a:xr[#1]{#2}{}%
\ifx\hyperrefLabel\:UnDef #3\else \hyperrefLabel\fi \b:xr}
\NewConfigure{xr}{2}
\Configure{xr}{\Link}{\EndLink}
\def\XR:rEfLiNK#1#2{{\xr:rEfLiNK#1}{\xr:rEfLiNK#2}}
\def\xr:rEfLiNK#1#2{\noexpand\XRrEfLiNK[\Get:HFile#2-]{#2}}
\def\Get:HFile#1-#2-{\:LikeRef{)F\:gobble #1F-}}
-_-_-
For xref file
\XGet:HFile acts on x1-10000.1 to retrieve the 1 between ‘x’ and ‘-’. The if acts on ‘)F1F-’ to get the file name. Where the ‘x’ got into the picture? Did \aXrefFile introduced it? where?
<..xr newlabel..>
\expandafter\xdef\csname r@\XR@prefix#2\endcsname{\XR:rEfLiNK #3}%
-_-_-
<..fix xr..>+
\long\def\XR@test#1#2#3#4\XR@{%
\ifx#1\newlabel
<.xr newlabel.>%
\else\ifx#1\@input
\edef\XR@list{\XR@list#2\relax}%
\fi\fi
\ifeof\@inputcheck\expandafter\XR@aux
\else\expandafter\XR@read\fi}
-_-_-