diff options
author | Karl Berry <karl@freefriends.org> | 2017-07-06 21:26:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-07-06 21:26:45 +0000 |
commit | 34144b78db92736c00a10650d04b947c56429504 (patch) | |
tree | 348fc66d723c1f47edb25a67deb2bd35cc3e850d /Master/texmf-dist/tex/latex/embrac/embrac.sty | |
parent | f691078fbf5a14c2afb87e0a2598f0654c4bf8e1 (diff) |
embrac (6jul17)
git-svn-id: svn://tug.org/texlive/trunk@44757 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/embrac/embrac.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/embrac/embrac.sty | 65 |
1 files changed, 35 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/latex/embrac/embrac.sty b/Master/texmf-dist/tex/latex/embrac/embrac.sty index 220f5a938f8..2a5d12675bd 100644 --- a/Master/texmf-dist/tex/latex/embrac/embrac.sty +++ b/Master/texmf-dist/tex/latex/embrac/embrac.sty @@ -8,7 +8,7 @@ % Web: https://bitbucket.org/cgnieder/embrac/ % E-Mail: contact@mychemistry.eu % -------------------------------------------------------------------------- -% Copyright 2012--2016 Clemens Niederberger +% Copyright 2012--2017 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -34,8 +34,8 @@ \RequirePackage { expl3 , xparse , l3keys2e } \ProvidesExplPackage {embrac} - {2016/01/07} - {0.6d} + {2017/07/04} + {0.7} {Upright Brackets in Emphasized Text} % -------------------------------------------------------------------------- @@ -91,46 +91,47 @@ % -------------------------------------------------------------------------- % THE MAIN PART: % storage of the tokens to be replaced: +\prop_new:N \l__embrac_emph_obrackets_symp_prop \prop_new:N \l__embrac_emph_obrackets_prop \prop_new:N \l__embrac_emph_obrackets_before_prop +\prop_new:N \l__embrac_emph_cbrackets_symp_prop \prop_new:N \l__embrac_emph_cbrackets_prop \prop_new:N \l__embrac_emph_cbrackets_after_prop +\cs_new_protected:Npn \__embrac_replace:Nnnn #1#2#3#4 + { + \tl_replace_all:Nnn #1 {#3} + { + \mode_if_math:TF + {#3} + { + \embrac_kern:n {#2} + \embrac_nobreak: + \embrac_braces_format:n {#3} + \embrac_nobreak: + \embrac_kern:n {#4} + \embrac_nobreak: + } + } + } +\cs_generate_variant:Nn \__embrac_replace:Nnnn {Nxx,Nnxx} + % do the replacing: \cs_new_protected:Npn \embrac_replace_brackets:N #1 { \prop_map_inline:Nn \l__embrac_emph_obrackets_prop { - \tl_replace_all:Nnn #1 {##1} - { - \mode_if_math:TF - {##1} - { - \embrac_kern:n - { \prop_item:Nn \l__embrac_emph_obrackets_before_prop {##1} } - \embrac_nobreak: - \embrac_braces_format:n {##1} - \embrac_nobreak: - \embrac_kern:n {##2} - \embrac_nobreak: - } - } + \__embrac_replace:Nxxn #1 + { \prop_item:Nn \l__embrac_emph_obrackets_before_prop {##1} } + { \prop_item:Nn \l__embrac_emph_obrackets_symp_prop {##1} } + {##2} } \prop_map_inline:Nn \l__embrac_emph_cbrackets_prop { - \tl_replace_all:Nnn #1 {##1} - { - \mode_if_math:TF - {##1} - { - \embrac_nobreak: - \embrac_kern:n {##2} - \embrac_nobreak: - \embrac_braces_format:n {##1} - \embrac_kern:n - { \prop_item:Nn \l__embrac_emph_cbrackets_after_prop {##1} } - } - } + \__embrac_replace:Nnxx #1 + {##2} + { \prop_item:Nn \l__embrac_emph_cbrackets_symp_prop {##1} } + { \prop_item:Nn \l__embrac_emph_cbrackets_after_prop {##1} } } } @@ -229,6 +230,7 @@ % internal add commands: \cs_new_protected:Npn \embrac_add_op_to_emph:nnn #1#2#3 { + \prop_put:Nnn \l__embrac_emph_obrackets_symp_prop {#1} {#1} \embrac_empty_or_no_value:nTF {#2} { \prop_put_if_new:Nnn \l__embrac_emph_obrackets_prop {#1} {0pt} } { \prop_put_if_new:Nnn \l__embrac_emph_obrackets_prop {#1} {#2} } @@ -239,6 +241,7 @@ \cs_new_protected:Npn \embrac_add_cl_to_emph:nnn #1#2#3 { + \prop_put:Nnn \l__embrac_emph_cbrackets_symp_prop {#1} {#1} \embrac_empty_or_no_value:nTF {#2} { \prop_put_if_new:Nnn \l__embrac_emph_cbrackets_prop {#1} {0pt} } { \prop_put_if_new:Nnn \l__embrac_emph_cbrackets_prop {#1} {#2} } @@ -452,3 +455,5 @@ 2015/09/06 - v0.6b - fix https://bitbucket.org/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 + other than 12 is possible) |