-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathxrlocal.sty
38 lines (37 loc) · 1.08 KB
/
xrlocal.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{xrlocal}
[1994/05/28 v5.02 eXternal References (DPC) modified]
\def\externaldocument{\@ifnextchar[\XR@{\XR@[]}}
\def\XR@[#1]#2{{%
\makeatletter
\def\XR@prefix{#1}%
\XR@next#2.aux\relax\\}}
\def\XR@next#1\relax#2\\{%
\edef\XR@list{#2}%
\XR@loop{#1}}
\def\XR@aux{%
\ifx\XR@list\@empty\else\expandafter\XR@explist\fi}
\def\XR@explist{\expandafter\XR@next\XR@list\\}
\def\XR@loop#1{\openin\@inputcheck#1\relax
\ifeof\@inputcheck
\PackageWarning{xr}{^^JNo file #1^^JLABELS NOT IMPORTED.^^J}%
\expandafter\XR@aux
\else
\PackageInfo{xr}{IMPORTING LABELS FROM #1}%
\expandafter\XR@read\fi}
\def\XR@read{%
\read\@inputcheck to\XR@line
\expandafter\XR@test\XR@line...\XR@}
\long\def\XR@test#1#2#3#4\XR@{%
\ifx#1\newlabel
\newlabel{\XR@prefix#2}{#3}%
\else\ifx#1\bibcite
\bibcite{#2}{#3}
\else\ifx#1\@input
\edef\XR@list{\XR@list#2\relax}%
\fi\fi\fi
\ifeof\@inputcheck\expandafter\XR@aux
\else\expandafter\XR@read\fi}
\endinput
%%
%% End of file `xrlocal.sty'.