[latex3-commits] [git/LaTeX3-latex3-hyperref] gh118: avoid stray braces if hyperref is detected issue #118 (8255aa4)

Ulrike Fischer fischer at troubleshooting-tex.de
Tue Apr 28 12:32:54 CEST 2020


Repository : https://github.com/latex3/hyperref
On branch  : gh118
Link       : https://github.com/latex3/hyperref/commit/8255aa4f5f0cce57c87e6636969cf288ce92d308

>---------------------------------------------------------------

commit 8255aa4f5f0cce57c87e6636969cf288ce92d308
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue Apr 28 11:44:25 2020 +0200

    avoid stray braces if hyperref is detected issue #118


>---------------------------------------------------------------

8255aa4f5f0cce57c87e6636969cf288ce92d308
 xr-hyper.sty | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/xr-hyper.sty b/xr-hyper.sty
index aeca59d..da3a294 100644
--- a/xr-hyper.sty
+++ b/xr-hyper.sty
@@ -1,6 +1,6 @@
-%% xr package (beta release)
+%% xr-hyper package (beta release)
 
-%% Copyright (C) 1993-2019 David Carlisle
+%% Copyright (C) 1993-2020 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
@@ -72,6 +72,10 @@
 %% 2019/10/03 v6.1
 %%   Incorporate updates to xr (including citation support)
 %%
+%% 2020/04/28 v6.2
+%%   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)
+%%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{xr-hyper}
          [2019/10/03 v6.1 eXternal References (DPC)]
@@ -118,8 +122,14 @@
   \read\@inputcheck to\XR at line
   \expandafter\XR at test\XR at line...\XR@}
 % 2019 update to match xr
+% 2020 don't extend r at -arguments if hyperref has been detected in the source
+% newlabel has already the right number of arguments
+\def\XR at HYPcompargs{{}{}{}}
 \long\def\XR at test#1#2#3#4\XR@{%
   \let\XR at tempa\@gobblethree
+  \ifx#1\HyperFirstAtBeginDocument
+    \def\XR at HYPcompargs{}%
+  \fi
   \ifx#1\newlabel
     \let\XR at tempa\@firstofthree
   \else\ifx#1\XR at bibcite
@@ -128,7 +138,7 @@
      \let\XR at tempa\@thirdofthree
   \fi\fi\fi
    \XR at tempa
-    {\expandafter\protected at xdef\csname r@\XR at prefix#2\endcsname{\XR at addURL{#3}{}{}{}}}%
+    {\expandafter\protected at xdef\csname r@\XR at prefix#2\endcsname{\XR at addURL{#3}\XR at HYPcompargs}}%
     {\expandafter\bibcite\expandafter{\XR at prefix#2}{#3}}%
     {\edef\XR at list{\XR at list\filename at area#2\relax}}%
   \ifeof\@inputcheck\expandafter\XR at aux
@@ -157,6 +167,4 @@
 
 \endinput
 %%
-%% End of file `xr.sty'.
-
-
+%% End of file `xr-hyper.sty'.





More information about the latex3-commits mailing list.