diff options
author | Norbert Preining <norbert@preining.info> | 2020-03-09 03:01:39 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-03-09 03:01:39 +0000 |
commit | 0561778af6f8fde0a3a1c334e2aab9a4f1142d6e (patch) | |
tree | c19fe45e4101aed56e7fb3602174c6a5e335d7d1 /macros/latex/contrib/chemmacros/chemmacros.module.redox.code.tex | |
parent | a8880a5ee484845d9a526c5ca8d21d31214af22b (diff) |
CTAN sync 202003090301
Diffstat (limited to 'macros/latex/contrib/chemmacros/chemmacros.module.redox.code.tex')
-rw-r--r-- | macros/latex/contrib/chemmacros/chemmacros.module.redox.code.tex | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/macros/latex/contrib/chemmacros/chemmacros.module.redox.code.tex b/macros/latex/contrib/chemmacros/chemmacros.module.redox.code.tex index 2c0421b470..f3f8b29a2d 100644 --- a/macros/latex/contrib/chemmacros/chemmacros.module.redox.code.tex +++ b/macros/latex/contrib/chemmacros/chemmacros.module.redox.code.tex @@ -52,9 +52,20 @@ \bool_new:N \l__chemmacros_ox_top_bool \bool_new:N \l__chemmacros_ox_align_center_bool +\ChemCompatibilityFrom{5.11} +\tl_new:N \l__chemmacros_ox_format_tl +\EndChemCompatibility + \int_new:N \l__chemmacros_ox_number_int \fp_new:N \l__chemmacros_ox_number_fp +\cs_new_protected:Npn \__chemmacros_ox_format:n #1 + { + \chemmacros_if_compatibility:nnTF {>=} {5.11} + { { \l__chemmacros_ox_format_tl {#1} } } + { \use:n {#1} } + } + \cs_new_protected:Npn \__chemmacros_ox_process_number:n #1 { \bool_if:NTF \l__chemmacros_ox_parse_bool @@ -180,7 +191,10 @@ \hbox_set:Nn \l__chemmacros_tmpa_box { \chemmacros_text:n - { \relsize {-3} \__chemmacros_ox_process_number:n {#1} } + { + \__chemmacros_ox_format:n + { \relsize {-3} \__chemmacros_ox_process_number:n {#1} } + } } \hbox_set:Nn \l__chemmacros_tmpb_box { \chemmacros_chemformula:n {#2} } \chemmacros_math:n @@ -196,7 +210,10 @@ { \box_use:N \l__chemmacros_tmpb_box \tl_use:N \l__chemmacros_ox_side_connect_tl - ( \__chemmacros_ox_process_number:n {#1} ) + ( + \__chemmacros_ox_format:n + { \__chemmacros_ox_process_number:n {#1} } + ) } } \bool_if:NT \l__chemmacros_ox_top_bool @@ -285,6 +302,11 @@ } \EndChemCompatibility +\ChemCompatibilityFrom{5.11} +\chemmacros_define_keys:nn {redox} + { format .tl_set:N = \l__chemmacros_ox_format_tl } +\EndChemCompatibility + % \ox[<keyval>]{<num>,<atom>} % \ox*[<keyval>]{<num>,<atom>} => always number on the top \cs_new_protected:Npn \chemmacros_ox:nnnn #1#2#3#4 @@ -433,3 +455,4 @@ 2015/09/30 - new option `explicit-zero-sign' 2020/02/02 - lazy boolean evaluation - prefer \legacy_if:nTF over \chemmacros_if_tex:nnTF +2020/03/02 - add option redox/format |