Debian Codegraph @

texmf-dist/tex/latex-dev/tools/xr.sty

raw
1 %%
2 %% This is file `xr.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% xr.dtx (with options: `package')
8 %%
9 %% This is a generated file.
10 %%
11 %% The source is maintained by the LaTeX Project team and bug
12 %% reports for it can be opened at https://latex-project.org/bugs/
13 %% (but please observe conditions on bug reports sent to that address!)
14 %%
15 %%
16 %% Copyright (C) 1993-2026
17 %% The LaTeX Project and any individual authors listed elsewhere
18 %% in this file.
19 %%
20 %% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
21 %% --------------------------------------------------------------------------
22 %%
23 %% It may be distributed and/or modified under the
24 %% conditions of the LaTeX Project Public License, either version 1.3c
25 %% of this license or (at your option) any later version.
26 %% The latest version of this license is in
27 %% https://www.latex-project.org/lppl.txt
28 %% and version 1.3c or later is part of all distributions of LaTeX
29 %% version 2005/12/01 or later.
30 %%
31 %% This file may only be distributed together with a copy of the LaTeX
32 %% `Tools Bundle'. You may however distribute the LaTeX `Tools Bundle'
33 %% without such generated files.
34 %%
35 %% The list of all files belonging to the LaTeX `Tools Bundle' is
36 %% given in the file `manifest.txt'.
37 %%
38 %% File: xr.dtx Copyright (C) 1993-2025 David Carlisle
39 \NeedsTeXFormat{LaTeX2e}
40 \DeclareRelease{v5}{2023-07-04}{xr-2023-07-04.sty}
41 \DeclareCurrentRelease{}{2024-12-22}
42 \ProvidesPackage{xr}
43 [2024-12-22 v6.00 eXternal References (DPC)]
44 \def\externaldocument{\@testopt\XR@cite{}}
45 \let\externalcitedocument\externaldocument
46 \def\XR@cite[#1]{\@testopt{\XR@[#1]}{}}
47 \def\XR@[#1][#2]#3{\@testopt{\XR@@{#1}{#2}{#3}}{#3.\XR@ext}}
48 \def\XR@@nocite{nocite}
49 \long\def\@gobblefour #1#2#3#4{}
50 \long\def\@firstoffour #1#2#3#4{#1}
51 \long\def\@secondoffour#1#2#3#4{#2}
52 \long\def\@thirdoffour #1#2#3#4{#3}
53 \long\def\@fourthoffour #1#2#3#4{#4}
54 \def\XR@addURL#1{\XR@@dURL#1{}{}{}{}\\}
55 \def\XR@@dURL#1#2#3#4#5\\{%
56 \unexpanded{{#1}{#2}{#3}{#4}}{\XR@URL}%
57 }%
58 \providecommand\XR@ext{pdf}
59 \def\XR@@#1#2#3[#4]{{%
60 \makeatletter
61 \def\XR@prefix{#1}%
62 \def\XR@nocite{#2}%
63 \ifx\XR@nocite\XR@@nocite
64 \let\XR@bibcite\vadjust
65 \else
66 \let\XR@bibcite\bibcite
67 \fi
68 \def\XR@URL{#4}%
69 \set@curr@file{#3}%
70 \filename@parse\@curr@file
71 \XR@next\@[email protected]\relax\\}}
72 \def\XR@next#1\relax#2\\{%
73 \edef\XR@list{#2}%
74 \XR@loop{#1}}
75 \def\XR@aux{%
76 \ifx\XR@list\@empty\else\expandafter\XR@explist\fi}
77
78 \def\XR@explist{\expandafter\XR@next\XR@list\\}
79 \def\XR@loop#1{\openin\@inputcheck{#1}\relax
80 \ifeof\@inputcheck
81 \PackageWarning{xr}{^^JNo file #1^^JLABELS NOT IMPORTED.^^J}%
82 \expandafter\XR@aux
83 \else
84 \PackageInfo{xr}{IMPORTING LABELS FROM #1}%
85 \expandafter\XR@read\fi}
86 \def\XR@read{%
87 \read\@inputcheck to\XR@line
88 \expandafter\XR@test\XR@line...\XR@}
89 \long\def\XR@test#1#2#3#4\XR@{%
90 \let\XR@tempa\@gobblefour
91 \ifx#1\newlabel
92 \let\XR@tempa\@firstoffour
93 \else\ifx#1\XR@bibcite
94 \let\XR@tempa\@secondoffour
95 \else\ifx#1\@input
96 \let\XR@tempa\@thirdoffour
97 \else\ifx#1\new@label@record
98 \let\XR@tempa\@fourthoffour
99 \fi\fi\fi\fi
100 \XR@tempa
101 {%
102 \expandafter\protected@xdef\csname r@\XR@prefix#2\endcsname{\XR@addURL{#3}}%
103 }%
104 {\expandafter\bibcite\expandafter{\XR@prefix#2}{#3}}%
105 {\edef\XR@list{\XR@list\filename@area#2\relax}}%
106 {%
107 \edef\next{\noexpand\new@label@record{\XR@prefix#2}{\unexpanded{#3}{xr-url}{\XR@URL}}}%
108 \next
109 }
110 \ifeof\@inputcheck\expandafter\XR@aux
111 \else\expandafter\XR@read\fi}
112 \endinput
113 %%
114 %% End of file `xr.sty'.