From 231ee51d8d56184431d4c5d9aed9119099e95fcd Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 4 May 2016 21:00:50 +0000 Subject: chemmacros (4may16) git-svn-id: svn://tug.org/texlive/trunk@40887 c570f23f-e606-0410-a88d-b1316a301751 --- .../chemmacros/chemmacros.module.base.code.tex | 41 ++++++++++------------ .../chemmacros.module.chemformula.code.tex | 16 ++++++--- .../chemmacros.module.reactions.code.tex | 34 +++++++++++++++++- .../texmf-dist/tex/latex/chemmacros/chemmacros.sty | 9 ++--- 4 files changed, 68 insertions(+), 32 deletions(-) (limited to 'Master/texmf-dist/tex/latex') 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 158bb962b70..04183909902 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 @@ -259,6 +259,8 @@ } \cs_generate_variant:Nn \chemmacros_cs_if_free_new_protected:Npn {c} +\RequirePackage{scrlfile} + % #1: counter % #2: singular % #3: plural @@ -266,15 +268,12 @@ % #5: Plural \cs_new_protected:Npn \chemmacros_add_cleveref_support:nnnnn #1#2#3#4#5 { - \AfterEndPreamble + \AfterPackage* {cleveref} { - \chemmacros_if_package_loaded:nT {cleveref} + \cs_if_exist:cF {cref@#1@name} { - \cs_if_exist:cF {cref@#1@name} - { - \crefname {#1} {#2} {#3} - \Crefname {#1} {#4} {#5} - } + \crefname {#1} {#2} {#3} + \Crefname {#1} {#4} {#5} } } } @@ -327,22 +326,19 @@ % #3: begin sentence \cs_new_protected:Npn \chemmacros_add_fancyref_support:nnn #1#2#3 { - \AfterEndPreamble + \AfterPackage* {fancyref} { - \chemmacros_if_package_loaded:nT {fancyref} - { - \chemmacros_cs_if_free_new:cpn {fancyref#1labelprefix} {#1} - \chemmacros_cs_if_free_new:cpn {fref#1name} {#2} - \chemmacros_cs_if_free_new:cpn {Fref#1name} {#3} - \exp_args:Nnx \frefformat {vario} { \exp_not:c {fancyref#1labelprefix} } - { \use:c {fref#1name} \fancyrefdefaultspacing ##1##3 } - \exp_args:Nnx \Frefformat {vario} { \exp_not:c {fancyref#1labelprefix} } - { \use:c {Fref#1name} \fancyrefdefaultspacing ##1##3 } - \exp_args:Nnx \frefformat {plain} { \exp_not:c {fancyref#1labelprefix} } - { \use:c {fref#1name} \fancyrefdefaultspacing ##1 } - \exp_args:Nnx \Frefformat {plain} { \exp_not:c {fancyref#1labelprefix} } - { \use:c {Fref#1name} \fancyrefdefaultspacing ##1 } - } + \chemmacros_cs_if_free_new:cpn {fancyref#1labelprefix} {#1} + \chemmacros_cs_if_free_new:cpn {fref#1name} {#2} + \chemmacros_cs_if_free_new:cpn {Fref#1name} {#3} + \exp_args:Nnx \frefformat {vario} { \exp_not:c {fancyref#1labelprefix} } + { \use:c {fref#1name} \fancyrefdefaultspacing ##1##3 } + \exp_args:Nnx \Frefformat {vario} { \exp_not:c {fancyref#1labelprefix} } + { \use:c {Fref#1name} \fancyrefdefaultspacing ##1##3 } + \exp_args:Nnx \frefformat {plain} { \exp_not:c {fancyref#1labelprefix} } + { \use:c {fref#1name} \fancyrefdefaultspacing ##1 } + \exp_args:Nnx \Frefformat {plain} { \exp_not:c {fancyref#1labelprefix} } + { \use:c {Fref#1name} \fancyrefdefaultspacing ##1 } } } \cs_generate_variant:Nn \chemmacros_add_fancyref_support:nnn {nnx} @@ -476,3 +472,4 @@ 2016/03/07 - \chemmacros_define_keys:nn and friends 2016/04/25 - macros for cleveref and fancyref support, \ChemCleverefSupport \ChemFancyrefSupport +2016/05/04 - fix \ChemCleverefSupport diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.chemformula.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.chemformula.code.tex index e15bc518d6a..ae27236733c 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.chemformula.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.chemformula.code.tex @@ -205,9 +205,11 @@ { formula .code:n = \chemmacros_set_formula_method:n {#1} } \EndChemCompatibility +\def\bla{bla} + \AtEndPreamble { - \bool_if:nT + \bool_if:nTF { !\l__chemmacros_formula_method_set_bool && @@ -217,10 +219,13 @@ } { \chemmacros_check_formula_method: } { - \chemmacros_if_compatiblity:nnTF {>=} {5.6} - { \msg_warning:nn {chemmacros} {default-formula-method} } - { \msg_info:nn {chemmacros} {default-formula-method} } - \chemmacros_set_formula_method:n {chemformula} + \bool_if:NF \l__chemmacros_formula_method_set_bool + { + \chemmacros_if_compatiblity:nnTF {>=} {5.6} + { \msg_info:nn {chemmacros} {default-formula-method} } + { \msg_warning:nn {chemmacros} {default-formula-method} } + \chemmacros_set_formula_method:n {chemformula} + } } } @@ -236,3 +241,4 @@ `chemist' and `chemfig' - don't automatically load an available method: load `chemformula' if the users haven't decided for themselves and issue a warning +2016/05/03 - correct wrong method check diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.reactions.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.reactions.code.tex index ed8f48cfd5c..652a300af86 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.reactions.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.reactions.code.tex @@ -151,8 +151,19 @@ \cs_if_exist:NT \KOMAClassName { \bool_set_true:N \l__chemmacros_reactions_tocbasic_bool } +\tl_new:N \l__chemmacros_reactions_tag_open_tl +\tl_new:N \l__chemmacros_reactions_tag_close_tl +\tl_new:N \l__chemmacros_reactions_before_tag_tl + \chemmacros_define_keys:nn {reactions} - { tocbasic .bool_set:N = \l__chemmacros_reactions_tocbasic_bool } + { + tocbasic .bool_set:N = \l__chemmacros_reactions_tocbasic_bool , + tag-open .tl_set:N = \l__chemmacros_reactions_tag_open_tl , + tag-open .initial:n = \{ , + tag-close .tl_set:N = \l__chemmacros_reactions_tag_close_tl , + tag-close .initial:n = \} , + before-tag .tl_set:N = \l__chemmacros_reactions_before_tag_tl + } \AtEndPreamble { @@ -175,13 +186,33 @@ { \chemmacros_translate:n {reactions} } [ \chemmacros_translate:n {Reactions} ] +\AfterPackage* {cleveref} + { + \creflabelformat {reaction} + { + #2 + \l__chemmacros_reactions_tag_open_tl + #1 + \l__chemmacros_reactions_tag_close_tl + #3 + } + } + \ChemFancyrefSupport {rct} { \chemmacros_translate:n {reaction} } [ \chemmacros_translate:n {Reaction} ] \EndChemCompatibility % create new tagform +\ChemCompatibilityTo{5.5} \newtagform {reaction} {\{} {\}} +\EndChemCompatibility +\ChemCompatibilityFrom{5.6} +\newtagform {reaction} + [\l__chemmacros_reactions_before_tag_tl] + {\l__chemmacros_reactions_tag_open_tl} + {\l__chemmacros_reactions_tag_close_tl} +\EndChemCompatibility \newcounter {chemmacros_save_reaction} \newcounter {reaction} @@ -399,3 +430,4 @@ - add cleveref support - add fancyref support - moved translations from lang module to reactions module +2016/05/04 - options `tag-open', `tag-close' and `before-tag' diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty index e119d05200c..c39f55d0614 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty @@ -31,10 +31,10 @@ % -------------------------------------------------------------------------- % package information: -\tl_const:Nn \c_chemmacros_date_tl {2016/05/02} +\tl_const:Nn \c_chemmacros_date_tl {2016/05/04} \tl_const:Nn \c_chemmacros_version_major_number_tl {5} \tl_const:Nn \c_chemmacros_version_minor_number_tl {6} -\tl_const:Nn \c_chemmacros_version_subrelease_tl {} +\tl_const:Nn \c_chemmacros_version_subrelease_tl {a} \tl_const:Nx \c_chemmacros_version_number_tl {\c_chemmacros_version_major_number_tl.\c_chemmacros_version_minor_number_tl} \tl_const:Nx \c_chemmacros_version_tl @@ -510,11 +510,12 @@ Version history (base) - new option `explicit-zero-sign' (redox) 2016/03/08 - version 5.5 - new module `polymers' -2016/04/25 - version 5.6 - generalization of the formula method concept, new +2016/05/02 - version 5.6 - generalization of the formula method concept, new methods `chemist' and `chemfig' (chemformula) - use `tocbasic' for the list of reactions if available (reactions) - fix reaction environments to obey \thereaction (reactions) - add cleveref and fancyref support (reactions) - + - add cleveref and fancyref support (scheme) +2016/05/04 - version 5.6a - fix small but annoying bugs (base and chemformula) -- cgit v1.2.3