diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.base.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.base.code.tex | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.base.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.base.code.tex index 3f84c9097b1..ed85a205e5e 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.base.code.tex +++ b/Master/texmf-dist/tex/latex/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 |