From f35565737733e319e7293a9fafe1b78e87f8a14e Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Sun, 21 Feb 2021 03:01:41 +0000
Subject: CTAN sync 202102210301

---
 macros/latex/contrib/embrac/embrac.sty | 75 ++++++++++++++++++++--------------
 1 file changed, 44 insertions(+), 31 deletions(-)

(limited to 'macros/latex/contrib/embrac/embrac.sty')

diff --git a/macros/latex/contrib/embrac/embrac.sty b/macros/latex/contrib/embrac/embrac.sty
index 55786b982a..7065a8709d 100644
--- a/macros/latex/contrib/embrac/embrac.sty
+++ b/macros/latex/contrib/embrac/embrac.sty
@@ -5,18 +5,18 @@
 % 
 % --------------------------------------------------------------------------
 % Clemens Niederberger
-% Web:    https://bitbucket.org/cgnieder/embrac/
+% Web:    https://github.com/cgnieder/embrac/
 % E-Mail: contact@mychemistry.eu
 % --------------------------------------------------------------------------
-% Copyright 2012--2019 Clemens Niederberger
+% Copyright 2012--2021 Clemens Niederberger
 % 
 % This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
 % 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.
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008/05/04 or later.
 % 
 % This work has the LPPL maintenance status `maintained'.
 % 
@@ -34,10 +34,17 @@
 \RequirePackage { expl3 , xparse , l3keys2e }
 \ProvidesExplPackage
   {embrac}
-  {2019/12/31}
-  {0.9}
+  {2021/02/20}
+  {0.9a}
   {Upright Brackets in Emphasized Text}
 
+% --------------------------------------------------------------------------
+\msg_new:nnn {embrac} {patching}
+  { Patching~ \token_to_str:c {#1} ... }
+
+\msg_new:nnn {embrac} {not-patching}
+  { \token_to_str:c {#1} ~ not~ defined.~ Not~ patching~ it ... }
+
 % --------------------------------------------------------------------------
 \bool_new:N \l__embrac_treat_biblatex_bool
 
@@ -116,7 +123,7 @@
     \tl_replace_all:Nnn #1 {#3}
       {
         \mode_if_math:TF
-          {#4}
+          {#3}
           {
             \embrac_nobreak:
             \embrac_kern:n {#2}
@@ -215,30 +222,35 @@
 % #1: name of macro to be treated
 \cs_new_protected:Npn \embrac_new_replacement_macro:n #1
   {
-    \seq_put_right:Nn \l__embrac_changed_macros_seq {#1}
-    \cs_new_eq:cc {embrac_orig_#1:n} {#1~}
-    \cs_generate_variant:cn {embrac_orig_#1:n} {V}
-    \cs_new_protected:cpn {__embrac_#1:n} ##1
-      {
-        \tl_set:Nn \l__embrac_tmpa_tl {##1}
-        \embrac_replace_brackets:N \l__embrac_tmpa_tl
-        \use:c {embrac_orig_#1:V} \l__embrac_tmpa_tl
-      }
-    \cs_new_protected:cpn {embrac_#1:nn} ##1##2
-      {
-        \group_begin:
-          \embrac_treat_bibparens:
-          \tl_if_eq:nnTF {##1} {*}
-            { \use:c {embrac_orig_#1:n} {##2} }
-            { \use:c {__embrac_#1:n} {##2} }
-        \group_end:
-      }
-    \exp_args:Nc \RenewDocumentCommand {#1} {sm}
+    \cs_if_exist:cTF {#1}
       {
-        \IfBooleanTF {##1}
-          { \use:c {embrac_#1:nn} {*} {##2} }
-          { \use:c {embrac_#1:nn} { } {##2} }
+        \msg_info:nnn {embrac} {patching} {#1}
+        \seq_put_right:Nn \l__embrac_changed_macros_seq {#1}
+        \cs_new_eq:cc {embrac_orig_#1:n} {#1~}
+        \cs_generate_variant:cn {embrac_orig_#1:n} {V}
+        \cs_new_protected:cpn {__embrac_#1:n} ##1
+          {
+            \tl_set:Nn \l__embrac_tmpa_tl {##1}
+            \embrac_replace_brackets:N \l__embrac_tmpa_tl
+            \use:c {embrac_orig_#1:V} \l__embrac_tmpa_tl
+          }
+        \cs_new_protected:cpn {embrac_#1:nn} ##1##2
+          {
+            \group_begin:
+              \embrac_treat_bibparens:
+              \tl_if_eq:nnTF {##1} {*}
+                { \use:c {embrac_orig_#1:n} {##2} }
+                { \use:c {__embrac_#1:n} {##2} }
+            \group_end:
+          }
+        \exp_args:Nc \RenewDocumentCommand {#1} {sm}
+          {
+            \IfBooleanTF {##1}
+              { \use:c {embrac_#1:nn} {*} {##2} }
+              { \use:c {embrac_#1:nn} { } {##2} }
+          }
       }
+      { \msg_info:nnn {embrac} {not-patching} {#1} }
   }
 
 \NewDocumentCommand \EmbracMakeKnown {m}
@@ -512,7 +524,7 @@
 2014/06/24 - v0.6  - add support for \textsl
 2014/07/03 - v0.6a - bugfix: remove unwanted (and unnecessary) expansion in
                      \__embrac_emph:n
-2015/09/06 - v0.6b - fix https://bitbucket.org/cgnieder/embrac/issues/5
+2015/09/06 - v0.6b - fix https://github.com/cgnieder/embrac/issues/5
 2015/11/13 - v0.6c - avoid code duplication
 2016/01/07 - v0.6d - \prop_get:Nn => \prop_item:Nn
 2017/07/04 - v0.7  - implement issue #8 (now treatment of symbols with catcode
@@ -521,3 +533,4 @@
                    - new macros \embparen, \embbracket and \emb
 2019/12/31 - v0.9  - new: \EmbracMakeKnown
                    - change penalties
+2021/02/20 - v0.9a - fix issue #13
-- 
cgit v1.2.3

