From 39eaa60079c4839f8ed7bcdcf907c6ce0e5e75ab Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Fri, 4 Jan 2019 21:49:07 +0000
Subject: biblatex-ext (4jan19)

git-svn-id: svn://tug.org/texlive/trunk@49597 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tex/latex/biblatex-ext/biblatex-ext-oa.sty     | 34 +++++++++++++++++-----
 1 file changed, 26 insertions(+), 8 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/biblatex-ext/biblatex-ext-oa.sty')

diff --git a/Master/texmf-dist/tex/latex/biblatex-ext/biblatex-ext-oa.sty b/Master/texmf-dist/tex/latex/biblatex-ext/biblatex-ext-oa.sty
index 930a3d1db3d..9795ae2f788 100644
--- a/Master/texmf-dist/tex/latex/biblatex-ext/biblatex-ext-oa.sty
+++ b/Master/texmf-dist/tex/latex/biblatex-ext/biblatex-ext-oa.sty
@@ -1,5 +1,5 @@
 \ProvidesPackage{biblatex-ext-oa}
-  [2018/11/23 v0.6 mark open access in biblatex bibliographies (MW)]
+  [2019/01/04 v0.6a mark open access in biblatex bibliographies (MW)]
 
 \protected\def\extblx@oa@error#1#2{%
   \PackageError{biblatex-ext-oa}{#1}{#2.}}
@@ -23,6 +23,15 @@
       Please see the documentation of biblatex-ext for more information}%
    \endinput}
 
+% xpatch has xapptobibmacro,
+% but I did not want to buy into all of expl3 just for this one macro
+% ... at least for the moment
+% note that this is not nearly as sophisticated as xpatch and does not
+% deal with optional arguments
+\newcommand*{\extblx@oa@apptobibmcro}[1]{%
+  \expandafter\apptocmd
+    \expandafter{\csname abx@macro@\detokenize{#1}\endcsname}}
+
 \newtoggle{extblx@oa@opt@forcedoiapi}
 \DeclareBibliographyOption[string]{openaccess}[true]{%
   \ifstrequal{#1}{forcedoiapi}
@@ -283,8 +292,15 @@
        {}
        {\extblx@oa@marginmark}}
 
-   \renewbibmacro*{begentry}{%
-     \usebibmacro{oamark}}
+   % patch begentry bibmacro
+   % safer than \renewbibmacro{begentry} if it contains something,
+   % but uses the internal implementation of bibmacros
+   \extblx@oa@apptobibmcro{begentry}
+     {\usebibmacro{oamark}}
+     {}
+     {\extblx@oa@warning@noline{%
+        Failed to patch 'begentry' bibmacro.\MessageBreak
+        The open access logo may not be displayed at all}}
 
    \ifbool{extblx@oa@opt@doiapi}
      {\NewBibliographyString{openaccessat}
@@ -307,11 +323,13 @@
            \newunit\newblock}
           {}}
 
-      \letbibmacro*{bbxorig:doi+eprint+url}{doi+eprint+url}
-      \renewbibmacro*{doi+eprint+url}{%
-        \usebibmacro{bbxorig:doi+eprint+url}%
-        \newunit\newblock
-        \usebibmacro{api:bestoaurl}}}}
+     \extblx@oa@apptobibmcro{doi+eprint+url}
+       {\newunit\newblock
+        \usebibmacro{api:bestoaurl}}
+       {}
+       {\extblx@oa@warning@noline{%
+          Failed to patch 'doi+eprint+url' bibmacro.\MessageBreak
+          The best open access URL might not be shown}}}}
   {\csletcs{extblx@oa@url@from}{extblx@oa@url@from@none}}
 
 
-- 
cgit v1.2.3

