78.18 Cross Referencing

<..context core-ref..>
 \NewConfigure{-@@ur}{2}
 \NewConfigure{pubs-li}{2}
 -_-_-

<..context core-ref..>+
 \catcode‘\:=12
 \expandafter\def\csname :temp\endcsname{\def\redospecialfrom[##1::##2]}
 \catcode‘\:=11
 
 \:temp
   {\ifundefined{\v!file :::#1}%
      \tttf[#1]%
    \else
      \def\doexternaldocument##1##2##3{\a:externaldocument
                        [##1]{}{}\goto{##3}[#1::#2]\b:externaldocument}%
      \csname\v!file :::#1\endcsname
    \fi }
 \NewConfigure{externaldocument}{2}
 -_-_-

<..context core-ref..>+
 \def\:tempc[#1][#2]{%
    \o:docite:[#1][#2]%
    \expandafter\ifx \csname o:bib\@@citedefault ref:\endcsname\relax
       \expandafter\global\expandafter\let
            \csname o:bib\@@citedefault ref:\endcsname = \empty
       \:warning{No configuration is available for \expandafter
                    \string \csname bib\@@citedefault ref\endcsname}%
    \fi
 }
 \HLet\docite\:tempc
 \ifx \dotypesetapublication\:UnDef\else
    \pend:defI\dotypesetapublication{\Link{}{##1}\EndLink}
 \fi
 -_-_-

<..context core-ref..>+
 \def\:tempc[#1]{%
       \Link{#1}{}\o:bibauthoryearref:[#1]\EndLink
 }
 \HLet\bibauthoryearref\:tempc
 -_-_-

<..context core-ref..>+
 \def\:tempc[#1]{%
    \bibalternative\v!left
    \bgroup
       \let\v!left=\empty
       \let\v!right=\empty
       \Link{#1}{}\o:bibauthoryearsref:[#1]\EndLink
    \egroup
    \bibalternative\v!right
 }
 \HLet\bibauthoryearsref\:tempc
 -_-_-

<..context core-ref..>+
 \def\:tempc[#1]{%
    \bibalternative\v!left
    \bgroup
       \let\v!left=\empty
       \let\v!right=\empty
       \Link{#1}{}\o:bibauthorref:[#1]\EndLink
    \egroup
    \bibalternative\v!right
 }
 \HLet\bibauthorref\:tempc
 -_-_-

<..context core-ref..>+
 \def\:tempc[#1]{%
    \bibalternative\v!left
    \bgroup
       \let\v!left=\empty
       \let\v!right=\empty
       \Link{#1}{}\o:bibyearref:[#1]\EndLink
    \egroup
    \bibalternative\v!right
 }
 \HLet\bibyearref\:tempc
 -_-_-
 
 \def\dodowritereference#1#2#3\end#4#5#6%
   {\bgroup
    \global\advance\crossreferencenumber \plusone\relax
    \if#1-\if#2:%
      \let\referenceprefix\empty
      \xdef\lastreference{#3}%
    \else
      % \xdef\lastreference{#1#2#3}% here we loose the space
    \fi\else
      % \xdef\lastreference{#1#2#3}% here we loose the space
    \fi
    \ifx\lastreference\empty \else
      \doiffirstreferenceoccurance\lastreference
        {\thisisdestination{\referenceprefix\lastreference}}%
      \referentieinfo>\lastreference
      \edef\:temp{#6}%
      \edef\dododowritereference
        {\writeutilitycommand
           {\mainreference{\referenceprefix}{\lastreference}{#4}%
              {#5}{\ifx\:temp\empty\else \mk:ref#6\fi}}}%
      \dododowritereference
    \fi
    \egroup
    \a:Tagreference
 }
 \def\mk:ref#1#2{%
     {\string\rEfLiNK{\lastreference}{#1}}%
     {\string\rEfLiNK{\lastreference}{#2}}} -_-_-

<..context core-refOUT..>
 \def\dodowritereference#1#2#3\end#4#5#6%
   {\bgroup
    \global\advance\crossreferencenumber \plusone\relax
    \if#1-\if#2:%
      \let\referenceprefix\empty
      \xdef\lastreference{#3}%
    \else
      % \xdef\lastreference{#1#2#3}% here we loose the space
    \fi\else
      % \xdef\lastreference{#1#2#3}% here we loose the space
    \fi
    \ifx\lastreference\empty \else
      \doiffirstreferenceoccurance\lastreference
        {\thisisdestination{\referenceprefix\lastreference}}%
      \referentieinfo>\lastreference
      \edef\:temp{#6}%
      \edef\dododowritereference
        {\writeutilitycommand
           {\mainreference{\referenceprefix}{\lastreference}{#4}%
              {#5}{\string\rEfLiNK{\lastreference}{#6}}}}%
      \dododowritereference
    \fi
    \egroup
    \a:Tagreference
 }
 -_-_-

<..context core-refOUT..>+
 \def\rEfLiNK#1#2{\Protect\Link{#1}{}#2\EndLink}
 \pend:defI\rawdoifinsetelse{\let\rEfLiNK\secondoftwoarguments}
 -_-_-

<..context core-refOUT..>+
 \NewConfigure{Tagreference}{1}
 \Configure{Tagreference}
   {\ifvmode
          \vbox{\Link{}{\lastreference}\EndLink\EndP}%
    \else \hbox{\Link{}{\lastreference}\EndLink}\fi}
 -_-_-