Debian Codegraph @

texmf-dist/tex/latex/hyperref/xr-hyper.sty

raw
1 %%
2 %% This is file `xr-hyper.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% xr-hyper.dtx (with options: `package')
8 %%
9 %% Copyright
10 %% 1995-2001 Sebastian Rahtz, with portions written by David Carlisle and Heiko Oberdiek
11 %% 2001-2015 Heiko Oberdiek
12 %% 2016-2019 Oberdiek Package Support Group
13 %% 2019-2026 LaTeX Project
14 %% https://github.com/latex3/hyperref/issues
15 %%
16 %% This file is part of the `Hyperref Bundle'.
17 %% -------------------------------------------
18 %%
19 %% This work may be distributed and/or modified under the
20 %% conditions of the LaTeX Project Public License, either version 1.3
21 %% of this license or (at your option) any later version.
22 %% The latest version of this license is in
23 %% http://www.latex-project.org/lppl.txt
24 %% and version 1.3 or later is part of all distributions of LaTeX
25 %% version 2005/12/01 or later.
26 %%
27 %% This work has the LPPL maintenance status `maintained'.
28 %%
29 %% The Current Maintainer of this work is the LaTeX Project.
30 %%
31 %% The list of all files belonging to the `Hyperref Bundle' is
32 %% given in the file `manifest.txt'.
33 %%
34 %% File: xr-hyper.dtx Copyright (C) 1993-2025 David Carlisle
35 \NeedsTeXFormat{LaTeX2e}
36 \ProvidesPackage{xr-hyper}
37 [2026-04-24 v7.01q eXternal References (DPC)]
38 \def\externaldocument{\@testopt\XR@cite{}}
39 \let\externalcitedocument\externaldocument
40 \def\XR@cite[#1]{\@testopt{\XR@[#1]}{}}
41 \def\XR@[#1][#2]#3{\@testopt{\XR@@{#1}{#2}{#3}}{#3.\XR@ext}}
42 \def\XR@@nocite{nocite}
43 \long\def\@gobblefour #1#2#3#4{}
44 \long\def\@firstoffour #1#2#3#4{#1}
45 \long\def\@secondoffour#1#2#3#4{#2}
46 \long\def\@thirdoffour #1#2#3#4{#3}
47 \long\def\@fourthoffour #1#2#3#4{#4}
48 \def\XR@addURL#1{\XR@@dURL#1{}{}{}{}\\}
49 \def\XR@@dURL#1#2#3#4#5\\{%
50 \unexpanded{{#1}{#2}{#3}{#4}}{\XR@URL}%
51 }%
52 \providecommand\XR@ext{pdf}
53 \def\XR@@#1#2#3[#4]{{%
54 \makeatletter
55 \def\XR@prefix{#1}%
56 \def\XR@nocite{#2}%
57 \ifx\XR@nocite\XR@@nocite
58 \let\XR@bibcite\vadjust
59 \else
60 \let\XR@bibcite\bibcite
61 \fi
62 \def\XR@URL{#4}%
63 \set@curr@file{#3}%
64 \filename@parse\@curr@file
65 \XR@next\@[email protected]\relax\\}}
66 \def\XR@next#1\relax#2\\{%
67 \edef\XR@list{#2}%
68 \XR@loop{#1}}
69 \def\XR@aux{%
70 \ifx\XR@list\@empty\else\expandafter\XR@explist\fi}
71 \def\XR@explist{\expandafter\XR@next\XR@list\\}
72 \def\XR@loop#1{\openin\@inputcheck{#1}\relax
73 \ifeof\@inputcheck
74 \PackageWarning{xr}{^^JNo file #1^^JLABELS NOT IMPORTED.^^J}%
75 \expandafter\XR@aux
76 \else
77 \PackageInfo{xr}{IMPORTING LABELS FROM #1}%
78 \expandafter\XR@read\fi}
79 \def\XR@read{%
80 \read\@inputcheck to\XR@line
81 \expandafter\XR@test\XR@line...\XR@}
82 \long\def\XR@test#1#2#3#4\XR@{%
83 \let\XR@tempa\@gobblefour
84 \ifx#1\newlabel
85 \let\XR@tempa\@firstoffour
86 \else\ifx#1\XR@bibcite
87 \let\XR@tempa\@secondoffour
88 \else\ifx#1\@input
89 \let\XR@tempa\@thirdoffour
90 \else\ifx#1\new@label@record
91 \let\XR@tempa\@fourthoffour
92 \fi\fi\fi\fi
93 \XR@tempa
94 {%
95 \expandafter\protected@xdef\csname r@\XR@prefix#2\endcsname{\XR@addURL{#3}}%
96 }%
97 {\expandafter\bibcite\expandafter{\XR@prefix#2}{#3}}%
98 {\edef\XR@list{\XR@list\filename@area#2\relax}}%
99 {%
100 \edef\next{\noexpand\new@label@record{\XR@prefix#2}{\unexpanded{#3}{xr-url}{\XR@URL}}}%
101 \next
102 }
103 \ifeof\@inputcheck\expandafter\XR@aux
104 \else\expandafter\XR@read\fi}
105 \endinput
106 %%
107 %% End of file `xr-hyper.sty'.