diff options
author | Norbert Preining <norbert@preining.info> | 2020-02-04 03:01:28 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-02-04 03:01:28 +0000 |
commit | fc358ce7332053945afe16ced2a271556cdccfb7 (patch) | |
tree | d723e8bbffaaffd6c8c6d51d46c54db70c61f67a /macros/latex/contrib/chemmacros/chemmacros.module.base.code.tex | |
parent | 34897eebd22c3de968b64f09bb4a371d96cb0b89 (diff) |
CTAN sync 202002040301
Diffstat (limited to 'macros/latex/contrib/chemmacros/chemmacros.module.base.code.tex')
-rw-r--r-- | macros/latex/contrib/chemmacros/chemmacros.module.base.code.tex | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/macros/latex/contrib/chemmacros/chemmacros.module.base.code.tex b/macros/latex/contrib/chemmacros/chemmacros.module.base.code.tex index 3f84c9097b..ed85a205e5 100644 --- a/macros/latex/contrib/chemmacros/chemmacros.module.base.code.tex +++ b/macros/latex/contrib/chemmacros/chemmacros.module.base.code.tex @@ -25,7 +25,7 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\ChemModule{base}{2020/01/16 basic chemmacros module} +\ChemModule{base}{2020/02/02 basic chemmacros module} % for the document hooks \ChemCompatibilityFrom{5.1} @@ -117,21 +117,27 @@ { \exp_args:Nc \NewDocumentCommand {NewChem#1} {#2} { - \bool_if:nTF { \cs_if_free_p:c {##1} && \cs_if_free_p:c {end##1} } - { #3 } + \bool_lazy_and:nnTF + { \cs_if_free_p:c {##1} } + { \cs_if_free_p:c {end##1} } + {#3} { \msg_error:nnn {chemmacros} {new-#1} {##1} } } \exp_args:Nc \NewDocumentCommand {RenewChem#1} {#2} { - \bool_if:nTF { \cs_if_free_p:c {##1} || \cs_if_free_p:c {end##1} } + \bool_lazy_or:nnTF + { \cs_if_free_p:c {##1} } + { \cs_if_free_p:c {end##1} } { \msg_error:nnn {chemmacros} {renew-#1} {##1} } - { #3 } + {#3} } \exp_args:Nc \NewDocumentCommand {DeclareChem#1} {#2} {#3} \exp_args:Nc \NewDocumentCommand {ProvideChem#1} {#2} { - \bool_if:nT { \cs_if_free_p:c {##1} && \cs_if_free_p:c {end##1} } - { #3 } + \bool_lazy_and:nT + { \cs_if_free_p:c {##1} } + { \cs_if_free_p:c {end##1} } + {#3} } \msg_new:nnn {chemmacros} {new-#1} { @@ -178,7 +184,6 @@ \cs_new_eq:NN \chemmacros_ignore_spaces: \tex_ignorespaces:D -\cs_new_protected:Npn \chemmacros_leave_vmode: { \hbox_unpack:N \c_empty_box } \cs_new_protected:Npn \chemmacros_nobreak: { \tex_penalty:D 10000 \scan_stop: } \cs_new_protected:Npn \chemmacros_allow_break: { \tex_penalty:D \c_zero_int } \cs_new_protected:Npn \chemmacros_skip_nobreak:N #1 @@ -188,13 +193,6 @@ \chemmacros_nobreak: } -% do I use those at all? -\prg_new_conditional:Npnn \chemmacros_tex_if:nn #1#2 {p,T,F,TF} - { \use:c { if #1 } #2 \prg_return_true: \else: \prg_return_false: \fi: } - -\prg_new_conditional:Npnn \chemmacros_latex_if:n #1 {p,T,F,TF} - { #1 { \prg_return_true: } { \prg_return_false: } } - % this is used at least in the `isotope' module \prg_new_conditional:Npnn \chemmacros_if_is_int:n #1 {p,T,F,TF} { @@ -272,7 +270,7 @@ { \cs_if_exist:cF {cref@#1@name} { - \chemmacros_tex_if:nnTF {@cref@capitalise} {} + \legacy_if:nTF {@cref@capitalise} { \crefname {#1} {#4} {#5} } { \crefname {#1} {#2} {#3} } \Crefname {#1} {#4} {#5} @@ -485,3 +483,4 @@ 2016/05/04 - fix \ChemCleverefSupport 2017/08/28 - add missing hyperref check 2020/01/16 - adapt to renaming of string case changing functions +2020/02/02 - lazy boolean evaluation |