diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/hyperref/xr-hyper.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/hyperref/xr-hyper.sty | 177 |
1 files changed, 59 insertions, 118 deletions
diff --git a/Master/texmf-dist/tex/latex/hyperref/xr-hyper.sty b/Master/texmf-dist/tex/latex/hyperref/xr-hyper.sty index d1f931a9bca..8e5e125e13a 100644 --- a/Master/texmf-dist/tex/latex/hyperref/xr-hyper.sty +++ b/Master/texmf-dist/tex/latex/hyperref/xr-hyper.sty @@ -1,70 +1,55 @@ -%% xr-hyper package (beta release) - -%% Copyright (C) 1993-2023 David Carlisle - -%% This is a modified version of the xr package from the Standard LaTeX -%% tools distribution. It has some internal changes to cooperate with -%% the hyperref package, and one new user level argument, also mainly of -%% use for hyperref. -%% If no problems are reported the version in the tools distribution -%% will be updated to match this at the next LaTeX release. - -%% \externaldocument[prefix][nocite]{document}[URL] - -%% The `document' referred to by the main argument is the file -%% document.aux -%% which must be somewhere on TeX's input path. -%% Some packages (eg hyperref) really need to know the location of the -%% final document rather than the aux file. By default this is assumed -%% to be `document.pdf'. A package may redefine the command \XR@ext to -%% change this default extension. However sometimes the final -%% document may be in a position unrelated to the aux file, or the -%% browser may not be able to find files at an arbitrary point in -%% TeX's input path, so the new final optional argument allows a full -%% URL to the final document to be specified. %% -%% \externaldocument{file}[http://here.xxx.edu/this/path/to/file.pdf] -%% -%% Version beta2 also added another improvement unrelated -%% to the hyperref support. Olivier Michel pointed out that -%% if the aux file was not on texinputs you could not always go -%% \externaldocument{/some/path/to/file} -%% specifically that worked if file.aux was a `simple' document with -%% one aux file, but if \include had been used, the `sub' aux files -%% would not be found by xr in the remote directory. -%% This version calls \filename@parse to get the directory name of the -%% remote directory, which is then explicitly prepended to the names of -%% any included aux files. -%% -%% -%% Version 6.1 incorporates linking to citations in external documents -%% (originally from xcite package and now included in xr. -%% -%% Many packages have variant citation commands (natbib, -%% biblatex,....) and the external document may or may not have used -%% hyperref. Because of these differences the citation linking may not -%% always work, it can be disabled by specifying [nocite] after the -%% prefix: -%% -%% \externaldocument[][nocite]{somefile} -%% -%% In the case of \ref, if the external document has not used -%% hyperref, this package will work like xr and produce the correct -%% text, but it can only produce a file link and -%% not target the exact location as the target document has no destinations -%% In this case you may prefer to use \ref* rather than -%% \ref to avoid generating a hyperlink. +%% This is file `xr-hyper.sty', +%% generated with the docstrip utility. %% +%% The original source files were: %% +%% xr-hyper.dtx (with options: `package') +%% +%% Copyright +%% 1995-2001 Sebastian Rahtz, with portions written by David Carlisle and Heiko Oberdiek +%% 2001-2015 Heiko Oberdiek +%% 2016-2019 Oberdiek Package Support Group +%% 2019-2024 LaTeX Project +%% https://github.com/latex3/hyperref/issues +%% +%% This file is part of the `Hyperref Bundle'. +%% ------------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is the LaTeX Project. +%% +%% The list of all files belonging to the `Hyperref Bundle' is +%% given in the file `manifest.txt'. +%% +%% File: xr-hyper.dtx Copyright (C) 1993-2024 David Carlisle \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{xr-hyper} - [2023-11-26 v7.01g eXternal References (DPC)] - + [2024-01-20 v7.01h eXternal References (DPC)] \def\externaldocument{\@testopt\XR@cite{}} \let\externalcitedocument\externaldocument \def\XR@cite[#1]{\@testopt{\XR@[#1]}{}} \def\XR@[#1][#2]#3{\@testopt{\XR@@{#1}{#2}{#3}}{#3.\XR@ext}} - +\def\XR@@nocite{nocite} +\long\def\@gobblefour #1#2#3#4{} +\long\def\@firstoffour #1#2#3#4{#1} +\long\def\@secondoffour#1#2#3#4{#2} +\long\def\@thirdoffour #1#2#3#4{#3} +\long\def\@fourthoffour #1#2#3#4{#4} +\def\XR@addURL#1{\XR@@dURL#1{}{}{}{}\\} +\def\XR@@dURL#1#2#3#4#5\\{% + \unexpanded{{#1}{#2}{#3}{#4}}{\XR@URL}% + }% +\providecommand\XR@ext{pdf} \def\XR@@#1#2#3[#4]{{% \makeatletter \def\XR@prefix{#1}% @@ -75,92 +60,48 @@ \let\XR@bibcite\bibcite \fi \def\XR@URL{#4}% - \filename@parse{#3}% - \XR@next#3.aux\relax\\}} -\def\XR@@nocite{nocite} + \set@curr@file{#3}% + \filename@parse\@curr@file + \XR@next\@curr@file.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} - -\long\def\@gobblethree #1#2#3{} -\long\def\@firstofthree #1#2#3{#1} -\long\def\@secondofthree#1#2#3{#2} -\long\def\@thirdofthree #1#2#3{#3} - -% 2023-05-13 we need to handle \newlabel's with two arguments differently -% to \newlabel's with five argument. For this we make use of -% XR@addURL: -\def\XR@addURL#1{\XR@@dURL#1{}{}{}{}\\} -\def\XR@@dURL#1#2#3#4#5\\{% - {#1}{#2}{#3}{#4}{\XR@URL}% - }% - \def\XR@explist{\expandafter\XR@next\XR@list\\} -\def\XR@loop#1{% -\openin\@inputcheck#1\relax +\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}% - \let\XR@testnewlabel\XR@testnewlabel@aux \expandafter\XR@read\fi} \def\XR@read{% \read\@inputcheck to\XR@line \expandafter\XR@test\XR@line...\XR@} -% 2019 update to match xr \long\def\XR@test#1#2#3#4\XR@{% - \let\XR@tempa\@gobblethree + \let\XR@tempa\@gobblefour \ifx#1\newlabel - \let\XR@tempa\@firstofthree + \let\XR@tempa\@firstoffour \else\ifx#1\XR@bibcite - \let\XR@tempa\@secondofthree + \let\XR@tempa\@secondoffour \else\ifx#1\@input - \let\XR@tempa\@thirdofthree - \fi\fi\fi + \let\XR@tempa\@thirdoffour + \else\ifx#1\new@label@record + \let\XR@tempa\@fourthoffour + \fi\fi\fi\fi \XR@tempa {% - \expandafter\protected@xdef\csname r@\XR@prefix#2\endcsname{\XR@addURL{#3}}% + \expandafter\protected@xdef\csname r@\XR@prefix#2\endcsname{\XR@addURL{#3}}% }% {\expandafter\bibcite\expandafter{\XR@prefix#2}{#3}}% {\edef\XR@list{\XR@list\filename@area#2\relax}}% + {% + \edef\next{\noexpand\new@label@record{\XR@prefix#2}{\unexpanded{#3}{xr-url}{\XR@URL}}}% + \next + } \ifeof\@inputcheck\expandafter\XR@aux \else\expandafter\XR@read\fi} - - -\providecommand\XR@ext{pdf} - \endinput %% %% End of file `xr-hyper.sty'. - - -%% History -%% -%% 1997/10/06 v6.00 beta2 -%% -%% 1999/09/01 v6.00 beta3 -%% Definitions of \XR@addURL corrected (Heiko Oberdiek). -%% -%% 2000/03/22 v6.00 beta4 -%% \xdef changed to \protected@xdef. -%% -%% 2019/10/03 v6.1 -%% Incorporate updates to xr (including citation support) -%% -%% 2020-05-14 v7.00e -%% add additional braces to \r@ only if hyperref is not detected in the aux -%% of the source document (https://github.com/latex3/hyperref/issues/118) -%% -%% 2023-05-15 v.7.00z -%% unified and simplified the brace handling: all defined references have now -%% five brace groups. Together with the planed change in LaTeX 2023-06-01 this -%% will improve the combination of hyperref/non-hyperref documents. -%% -%% 2023-11-26 -%% -%% Always store the URL/file name of the external document to allow file links -%% even if it has no destinations. -%% |