diff options
Diffstat (limited to 'Master')
16 files changed, 219 insertions, 135 deletions
diff --git a/Master/texmf-dist/doc/latex/chemmacros/README b/Master/texmf-dist/doc/latex/chemmacros/README index 186788ccf04..05e46321e79 100644 --- a/Master/texmf-dist/doc/latex/chemmacros/README +++ b/Master/texmf-dist/doc/latex/chemmacros/README @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -the CHEMMACROS package v5.8 2017/04/24 +the CHEMMACROS package v5.8a 2017/06/13 comprehensive support for typesetting chemistry documents diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros.history b/Master/texmf-dist/doc/latex/chemmacros/chemmacros.history index ade71f33e6f..314dbafafca 100644 --- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros.history +++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros.history @@ -364,3 +364,12 @@ Version history (nomenclature) - new options `cip-inner-format', `cip-outer-format' and `cip-number-format' (nomenclature) +2017/06/13 - version 5.8a - changes to compatibility test: it now works also + for subreleases + - change behaviour of \ChemCompatibilityTo and + \ChemCompatibilityBetween in order to cope with + the changed compatibility test; adapt all files + reflecting those changes + - change behaviour of + \__chemmacros_break_point_insert:nnn so it does + nothing as last token in \iupac (nomenclature) diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.pdf b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.pdf Binary files differindex 9a8d6932576..54b518ba25d 100644 --- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.pdf +++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.pdf diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.tex b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.tex index b806c2190a3..d6fc4f13bec 100644 --- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.tex +++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.tex @@ -1,5 +1,5 @@ -% arara: pdflatex -% arara: biber +% !arara: pdflatex +% !arara: biber % arara: pdflatex % arara: pdflatex % -------------------------------------------------------------------------- @@ -310,7 +310,7 @@ \usetikzlibrary{calc,positioning,decorations.pathmorphing,patterns} % \newpackagename\chemmacros{chemmacros} -\newcommand*\chemmacrosversion{\csname c_chemmacros_version_number_tl\endcsname} +\newcommand*\chemmacrosversion{\csname c_chemmacros_version_tl\endcsname} \newpackagename\chemformula{chemformula} \newpackagename\ghsystem{ghsystem} \newpackagename\chemgreek{chemgreek} @@ -627,14 +627,12 @@ important and \emph{breaking} differences: It is actually not true that \chemmacros' has no package options any more. It has one very important package option: \begin{options} - \keychoice{compatibility}{\meta{num},newest,latest}\Default{\chemmacrosversion} - Let's you specify the version number of \chemmacros\ you want to use. Any + \keychoice{compatibility}{\meta{version},newest,latest}\Default{\chemmacrosversion} + Let's you specify the version of \chemmacros\ you want to use. Any version earlier than 5.0 will load v4.7. \ie, the last version before \chemmacros\ got its modular structure\footnote{Mostly: the loaded v4.7 has got a few fixes}. Not using the option will always load the newest - version. Please note that you only can specify the \emph{number} of the - version. For a version \enquote{5.2c} you can only set compatibility mode - \enquote{5.2} but not specify the subrelease. + version. Both values \code{newest} and \code{latest} will choose the latest version available. @@ -643,25 +641,29 @@ has one very important package option: In your document you can check for the compatibility mode. For the following functions it is important to understand the rules: \emph{greater} means \emph{newer}. The version number is \emph{not} a usual decimal number! The -syntax for \meta{num} is \meta{major}\code{.}\meta{minor}. This means that a -version 5.11 is \emph{newer} than a version 5.7! In the same way \emph{less} -means \emph{older}. As last example: 5.10 is \emph{newer} (greater) than 5.1. +syntax for \meta{version} is \meta{major}\code{.}\meta{minor}\meta{optional + subrelease}. This means that a version~5.11 is \emph{newer} than a +version~5.7! In the same way \emph{less} means \emph{older}. As last +example: 5.10~is \emph{newer} (greater) than~5.1. \meta{optional subrelease} +is a lowercase letter which might or might not be present in a version number. +Version~5.7b is newer than~5.7a which in turn is newer than~5.7. \begin{commands} - \command{IfChemCompatibilityTF}[\marg{comp}\marg{num}\marg{true}\marg{false}] - Checks the value given through the option \option{compatibility} against - \meta{num} using \meta{comp} and either leaves \meta{true} or \meta{false} - in the input stream. \meta{comp} can be one of \code{<}, \code{<=}, - \code{=}, \code{>=} or \code{>}. - \command{IfChemCompatibilityT}[\marg{comp}\marg{num}\marg{true}] + \expandable\command{IfChemCompatibilityTF}[\marg{comp}\marg{version}% + \marg{true}\marg{false}] Checks the value given through the option \option{compatibility} against - \meta{num} using \meta{comp} and leaves \meta{true} in the input stream if - the check is logically true. \meta{comp} can be one of \code{<}, + \meta{version} using \meta{comp} and either leaves \meta{true} or + \meta{false} in the input stream. \meta{comp} can be one of \code{<}, \code{<=}, \code{=}, \code{>=} or \code{>}. - \command{IfChemCompatibilityF}[\marg{comp}\marg{num}\marg{false}] + \expandable\command{IfChemCompatibilityT}[\marg{comp}\marg{version}\marg{true}] Checks the value given through the option \option{compatibility} against - \meta{num} using \meta{comp} and leaves \meta{false} in the input stream if - the check is logically false. \meta{comp} can be one of \code{<}, - \code{<=}, \code{=}, \code{>=} or \code{>}. + \meta{version} using \meta{comp} and leaves \meta{true} in the input + stream if the check is logically true. \meta{comp} can be one of + \code{<}, \code{<=}, \code{=}, \code{>=} or \code{>}. + \expandable\command{IfChemCompatibilityF}[\marg{comp}\marg{version}\marg{false}] + Checks the value given through the option \option{compatibility} against + \meta{version} using \meta{comp} and leaves \meta{false} in the input + stream if the check is logically false. \meta{comp} can be one of + \code{<}, \code{<=}, \code{=}, \code{>=} or \code{>}. \end{commands} A possible usage: @@ -681,31 +683,33 @@ we never know what the future actually will bring \chemmacros\ now has the tools for tying code to a version number: \begin{commands} \expandable\explcommand{chemmacros_if_compatibility:nn}[\TF\ \marg{comp} - \marg{num} \marg{true} \marg{false}] + \marg{version} \marg{true} \marg{false}] expl3 version of \cs{IfChemCompatibilityTF}. \end{commands} In modules one can try adding code for a certain version or range of versions: \begin{commands} - \command{ChemCompatibility}[\marg{num} \meta{code} \cs{EndChemCompatibility}] + \command{ChemCompatibility}[\marg{version} \meta{code} \cs{EndChemCompatibility}] Leaves \meta{code} in the input stream if the compatibility version $x$ - given by \option{compatibility} matches \meta{num} - ($x=\text{\meta{num}}$). - \command{ChemCompatibilityFrom}[\marg{num} \meta{code} \cs{EndChemCompatibility}] + given by \option{compatibility} matches \meta{version} + ($x=\text{\meta{version}}$). + \command{ChemCompatibilityFrom}[\marg{version} \meta{code} \cs{EndChemCompatibility}] Leaves \meta{code} in the input stream if the compatibility version $x$ - given by \option{compatibility} matches \meta{num} or newer. This means - \meta{num} is the \emph{oldest} version allowed - ($x\geq\text{\meta{num}}$). - \command{ChemCompatibilityTo}[\marg{num} \meta{code} \cs{EndChemCompatibility}] - Leaves \meta{code} in the input stream if the compatibility version $x$ given - by \option{compatibility} matches \meta{num} or older. This means - \meta{num} is the \emph{newest} version allowed - ($x\leq\text{\meta{num}}$). - \command{ChemCompatibilityBetween}[\marg{num1}\marg{num2} \meta{code} + given by \option{compatibility} matches \meta{version} or newer. This + means \meta{version} is the \emph{oldest} version allowed + ($x\geq\text{\meta{version}}$). + \command{ChemCompatibilityTo}[\marg{version} \meta{code} \cs{EndChemCompatibility}] + \changedversion{5.8a}Leaves \meta{code} in the input stream if the + compatibility version $x$ given by \option{compatibility} matches any + version up to and \emph{excluding} \meta{version}. This means + \meta{version} is the \emph{oldest} version \emph{not} allowed + ($x<\text{\meta{version}}$). + \command{ChemCompatibilityBetween}[\marg{version 1}\marg{version 2} \meta{code} \cs{EndChemCompatibility}] - Leaves \meta{code} in the input stream if the compatibility version $x$ - given by \option{compatibility} lies between \meta{num1} and \meta{num2} - ($\text{\meta{num1}}\leq x\leq\text{\meta{num2}}$). + \changedversion{5.8a}Leaves \meta{code} in the input stream if the + compatibility version $x$ given by \option{compatibility} lies between and + \emph{including} \meta{version 1} up to and \emph{excluding} \meta{version 2} + ($\text{\meta{version 1}}\leq x<\text{\meta{version 2}}$). \command{EndChemCompatibility} This macro \emph{must} end each of the \cs*{ChemCompatibility\ldots} macros. diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.acid-base.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.acid-base.code.tex index 4ba72d344ae..fb998832c9a 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.acid-base.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.acid-base.code.tex @@ -66,7 +66,7 @@ \tl_set:cn {l__chemmacros_#2_tl} { \chemmacros_translate:n {#2} } - \chemmacros_if_compatibility:nnTF {>} {5.6} + \chemmacros_if_compatibility:nnTF {>=} {5.7} { \chemmacros_declare_translation:nnn {#2} {fallback} {#3} } { \DeclareTranslationFallback {#2} {#3} } \cs_set_protected:Npn #1 @@ -139,7 +139,7 @@ } % -------------------------------------------------------------------------- -\ChemCompatibilityTo{5.5} +\ChemCompatibilityTo{5.6} \DeclareTranslation {English} {K-acid} {\mathrm{a}} \DeclareTranslation {German} {K-acid} {\mathrm{s}} \DeclareTranslation {Dutch} {K-acid} {\mathrm{z}} 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 a1d3ac24048..9f54d9317f7 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 @@ -196,7 +196,7 @@ \EndChemCompatibility % -------------------------------------------------------------------------- -\ChemCompatibilityTo{5.0} +\ChemCompatibilityTo{5.1} \chemmacros_set_formula_method:n {chemformula} \EndChemCompatibility diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.lang.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.lang.code.tex index a087398981e..b9dea089d24 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.lang.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.lang.code.tex @@ -48,7 +48,7 @@ \tl_new:N \l__chemmacros_current_language_tl \tl_const:Nx \c__chemmacros_keyword_prefix_tl - { \chemmacros_if_compatibility:nnT {>} {5.6} {chem-keyword-} } + { \chemmacros_if_compatibility:nnT {>=} {5.7} {chem-keyword-} } \prop_new:N \g_chemmacros_translations_prop @@ -80,7 +80,7 @@ language .initial:n = auto } -\ChemCompatibilityTo{5.2} +\ChemCompatibilityTo{5.3} \chemmacros_define_global_keys:n { german .meta:n = { language = german } , @@ -102,7 +102,6 @@ } % -------------------------------------------------------------------------- -% \ChemCompatibilityFrom{5.6} \cs_new_protected:Npn \__chemmacros_declare_translation:nw #1#2=#3\q_stop { \tl_set:Nx \l__chemmacros_tmpa_tl { \tl_trim_spaces:n {#2} } @@ -144,7 +143,6 @@ \NewDocumentCommand \DeclareChemTranslation {mmm} { \chemmacros_declare_translation:nnn {#1} {#2} {#3} } \@onlypreamble \DeclareChemTranslation -% \EndChemCompatibility \cs_new:Npn \__chemmacros_parse_translate_list_entry:nnn #1#2#3 {} diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.nomenclature.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.nomenclature.code.tex index 037f863190b..5a347b66e9d 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.nomenclature.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.nomenclature.code.tex @@ -25,7 +25,7 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\ChemModule{nomenclature}{2017/07/10 chemical names} +\ChemModule{nomenclature}{2017/06/11 chemical names} \RequirePackage{scrlfile} @@ -141,7 +141,7 @@ \chemmacros_make_iupac: } -\ChemCompatibilityTo{5.1} +\ChemCompatibilityTo{5.2} \cs_new_protected:Npn \chemmacros_make_iupac: { \bool_if:NT \l__chemmacros_in_document_bool @@ -242,7 +242,7 @@ \chemmacros_define_keys:nn {nomenclature} { cip-kern .dim_set:N = \l__chemmacros_cip_kern_dim } -\ChemCompatibilityTo{5.1} +\ChemCompatibilityTo{5.2} \cs_new_protected:Npn \chemmacros_cip:n #1 { \textit{#1} \tex_kern:D \l__chemmacros_cip_kern_dim } @@ -250,7 +250,7 @@ { \chemmacros_cip:n {#1} } \EndChemCompatibility -\ChemCompatibilityBetween{5.2}{5.7} +\ChemCompatibilityBetween{5.2}{5.8} \cs_new_protected:Npn \chemmacros_cip:n #1 { \int_zero:N \l__chemmacros_tmpa_int @@ -434,7 +434,7 @@ % #1: pre break % #2: post break % #3: no break -\ChemCompatibilityTo{5.0} +\ChemCompatibilityTo{5.1} \cs_new_protected:Npn \__chemmacros_break_point_insert:nnn #1#2#3 { \chemmacros_nobreak: @@ -443,12 +443,12 @@ } \EndChemCompatibility -\ChemCompatibilityFrom{5.1} +\ChemCompatibilityBetween{5.1}{5.8} \cs_new_protected:Npn \__chemmacros_break_point_insert:nnn #1#2#3 { \mode_if_math:TF {#3} - { + { \chemmacros_nobreak: \tex_discretionary:D {#1} {#2} {#3} \chemmacros_allow_hyphens: @@ -456,6 +456,22 @@ } \EndChemCompatibility +\ChemCompatibilityFrom{5.8a} +\cs_new_protected:Npn \__chemmacros_break_point_insert:nnn #1#2#3 + { + \mode_if_math:TF + {#3} + { + \peek_meaning:NTF \group_end: + {#3} + { + \chemmacros_nobreak: + \tex_discretionary:D {#1} {#2} {#3} + \chemmacros_allow_hyphens: + } + } + } +\EndChemCompatibility \dim_new:N \l__chemmacros_iupac_hyphen_pre_dim \dim_set:Nn \l__chemmacros_iupac_hyphen_pre_dim { .01em } @@ -463,15 +479,17 @@ \dim_set:Nn \l__chemmacros_iupac_hyphen_post_dim { -.03em } \dim_new:N \l__chemmacros_iupac_break_dim \dim_set:Nn \l__chemmacros_iupac_break_dim { .03em } +\skip_new:N \l__chemmacros_iupac_break_skip +\skip_set:Nn \l__chemmacros_iupac_break_skip { .03em plus .07em } \chemmacros_define_keys:nn {nomenclature} { hyphen-pre-space .dim_set:N = \l__chemmacros_iupac_hyphen_pre_dim , hyphen-post-space .dim_set:N = \l__chemmacros_iupac_hyphen_post_dim , - break-space .dim_set:N = \l__chemmacros_iupac_break_dim + break-space .skip_set:N = \l__chemmacros_iupac_break_skip } -\ChemCompatibilityTo{5.1} +\ChemCompatibilityTo{5.2} \cs_new_protected:Npn \chemmacros_break_point_hyphen: { \__chemmacros_break_point_insert:nnn @@ -483,18 +501,6 @@ \tex_kern:D \l__chemmacros_iupac_hyphen_post_dim } } - -\cs_new_protected:Npn \chemmacros_break_point: - { - \__chemmacros_break_point_insert:nnn - {-} - { } - { - \mode_if_math:TF - { | } - { \tex_kern:D \l__chemmacros_iupac_break_dim } - } - } \EndChemCompatibility \ChemCompatibilityFrom{5.2} @@ -509,6 +515,7 @@ \tex_kern:D \l__chemmacros_iupac_hyphen_post_dim } } +\EndChemCompatibility \cs_new_protected:Npn \chemmacros_break_point: { @@ -521,7 +528,6 @@ { \tex_kern:D \l__chemmacros_iupac_break_dim } } } -\EndChemCompatibility \cs_new_protected:Npn \chemmacros_break_point_opening_paren: { \__chemmacros_break_point_insert:nnn { - } { ( } { ( } } @@ -584,10 +590,13 @@ \cs_new_protected:Npn \chemmacros_make_shorthands: { - \chemmacros_if_document:T + \chemmacros_if_compatibility:nnT {>=} {5.2} { - \chemmacros_for_all_iupac_shorthands_do:n - { \prop_item:Nn \l__chemmacros_iupac_shorthands_prop {##1} } + \chemmacros_if_document:T + { + \chemmacros_for_all_iupac_shorthands_do:n + { \prop_item:Nn \l__chemmacros_iupac_shorthands_prop {##1} } + } } } @@ -653,7 +662,7 @@ \cs_new_protected:Npn \chemmacros_iupac:n #1 { \chemmacros_iupac:nn {} {#1} } -\ChemCompatibilityTo{5.2} +\ChemCompatibilityTo{5.3} % Thanks to Joseph Wright and Enrico Gregorio for the help on the curious % redefinition of \- and the end of the compilation % see http://tex.stackexchange.com/q/42405/5049 for reference @@ -745,7 +754,7 @@ \NewChemMacroset {Latin} {mm} { \chemmacros_define_latin:Nn #1 {#2} } -\ChemCompatibilityTo{5.6} +\ChemCompatibilityTo{5.7} \chemmacros_define_keys:nn {nomenclature} { latin-format .tl_set:N = \l__chemmacros_latin_format_tl , @@ -886,3 +895,5 @@ 2017/04/17 - fix erroneous definition of \chemmacros_allow_hyphens: - new options `cip-inner-format', `cip-outer-format' and `cip-number-format' +2017/06/11 - change behaviour of \__chemmacros_break_point_insert:nnn so + it does nothing as last token in \iupac diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.particles.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.particles.code.tex index 82473a53325..44cde878408 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.particles.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.particles.code.tex @@ -130,7 +130,7 @@ \NewChemNucleophile \Nuc {Nu} \NewChemNucleophile \ba {ba} -\ChemCompatibilityTo{5.2} +\ChemCompatibilityTo{5.3} \DeclareChemDeprecated \Hto \Oxo \DeclareChemDeprecated \Nu \Nuc \EndChemCompatibility diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.phases.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.phases.code.tex index 2a5069f5bbb..5f2bcc1dcda 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.phases.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.phases.code.tex @@ -44,7 +44,7 @@ \NewChemMacroset {Phase} {mm} { \chemmacros_define_phase:Nn #1 {#2} } -\ChemCompatibilityTo{5.6} +\ChemCompatibilityTo{5.7} \cs_new_protected:Npn \chemmacros_define_phase:Nn #1#2 { \tl_set:Nx \l__chemmacros_tmpa_tl { phase-\chemmacros_remove_backslash:N #1 } @@ -98,7 +98,7 @@ \NewChemPhase \aq {aq} % -------------------------------------------------------------------------- -\ChemCompatibilityTo{5.5} +\ChemCompatibilityTo{5.6} \DeclareTranslation {English} {phase-sld} {s} \DeclareTranslation {German} {phase-sld} {f} 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 7dde472d7a6..35be8b3e905 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 @@ -91,7 +91,7 @@ { \l__chemmacros_reaction_heading_tl {#1} } \cs_generate_variant:Nn \__chemmacros_reaction_heading:n { V } -\ChemCompatibilityTo{5.5} +\ChemCompatibilityTo{5.6} \tl_set:Nn \l__chemmacros_reaction_lorname_tl { \chemmacros_translate:n {reaction} } \EndChemCompatibility @@ -139,7 +139,7 @@ \@starttoc {lor} } -\ChemCompatibilityTo{5.5} +\ChemCompatibilityTo{5.6} \cs_new_protected:Npn \l@reaction #1#2 { \@dottedtocline {1} {1.5em} {2.3em} {#1} {#2} } \EndChemCompatibility @@ -204,7 +204,7 @@ \EndChemCompatibility % create new tagform -\ChemCompatibilityTo{5.5} +\ChemCompatibilityTo{5.6} \newtagform {reaction} {\{} {\}} \EndChemCompatibility \ChemCompatibilityFrom{5.6} @@ -216,7 +216,7 @@ \newcounter {chemmacros_save_reaction} \newcounter {reaction} -\ChemCompatibilityTo{5.5} +\ChemCompatibilityTo{5.6} \cs_new_protected:Npn \__chemmacros_begin_reaction: { % create individual names for `hyperref': @@ -291,7 +291,7 @@ } \cs_generate_variant:Nn \chemmacros_declare_reaction_env:nnnn {nnnV} -\ChemCompatibilityTo{5.5} +\ChemCompatibilityTo{5.6} \cs_new_protected:Npn \chemmacros_reaction_read:nnw #1#2#3 \end { \begin{#1}#2 @@ -348,7 +348,7 @@ \NewChemReaction {reactions*} {align*} % -------------------------------------------------------------------------- -\ChemCompatibilityTo{5.5} +\ChemCompatibilityTo{5.6} \DeclareTranslationFallback {list-of-reactions} {List~ of~ Reactions} \DeclareTranslation {English} {list-of-reactions} {List~ of~ Reactions} \DeclareTranslation {German} {list-of-reactions} {Reaktionsverzeichnis} diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.redox.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.redox.code.tex index 8d9918e498a..9e95b9b076a 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.redox.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.redox.code.tex @@ -82,7 +82,7 @@ \group_end: } -\ChemCompatibilityTo{5.3} +\ChemCompatibilityTo{5.4} \cs_new_protected:Npn \__chemmacros_ox_sign:n #1 { \bool_if:nT diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.scheme.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.scheme.code.tex index 8a3ed06c620..1a07bd1c500 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.scheme.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.scheme.code.tex @@ -247,7 +247,7 @@ } % -------------------------------------------------------------------------- -\ChemCompatibilityTo{5.5} +\ChemCompatibilityTo{5.6} \DeclareTranslationFallback {scheme-name} {Scheme} \DeclareTranslation {English} {scheme-name} {Scheme} \DeclareTranslation {German} {scheme-name} {Schema} diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.spectroscopy.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.spectroscopy.code.tex index 8ba4c066cc6..30223fc583f 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.spectroscopy.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.spectroscopy.code.tex @@ -120,7 +120,7 @@ \tl_set:Nn \l__chemmacros_nmr_element_default_tl {#2} } -\ChemCompatibilityTo{5.7} +\ChemCompatibilityTo{5.8} \cs_new_protected:Npn \__chemmacros_nmr_base:nn #1#2 { \tl_if_blank:VF \g__chemmacros_nmr_element_coupled_tl @@ -363,11 +363,11 @@ \NewDocumentCommand \chemmacros_data:w { smo } { \bool_if:NT \l__chemmacros_nmr_list_bool { \item } - { - \tl_use:N \l__chemmacros_nmr_format_tl #2 - \IfNoValueF {#3} { ~ ( #3 ) } - \IfBooleanT {#1} { \bool_if:NT \l__chemmacros_nmr_use_equal_bool { : } } - } + { + \tl_use:N \l__chemmacros_nmr_format_tl #2 + \IfNoValueF {#3} { ~ ( #3 ) } + \IfBooleanT {#1} { \bool_if:NT \l__chemmacros_nmr_use_equal_bool { : } } + } \IfBooleanF {#1} { \bool_if:NT \l__chemmacros_nmr_use_equal_bool { ~ = } } } @@ -448,7 +448,11 @@ \tl_set:Nn \l__chemmacros_nmr_coupling_nuclei_tl { \c_math_subscript_token - { \chemmacros_chemformula:n {#2} } + { + \l__chemmacros_nmr_coupling_nuclei_pre_tl + \chemmacros_chemformula:n {#2} + \l__chemmacros_nmr_coupling_nuclei_post_tl + } } } { diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.thermodynamics.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.thermodynamics.code.tex index 3d97ecbb6cb..cf49fd0695b 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.thermodynamics.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.thermodynamics.code.tex @@ -137,7 +137,7 @@ \NewChemState \entropy { symbol = S , unit = \joule\per\kelvin\per\mole , pre = } \NewChemState \gibbs { symbol = G , unit = \kilo\joule\per\mole } -\ChemCompatibilityTo{5.2} +\ChemCompatibilityTo{5.3} \DeclareChemDeprecated \State \state \DeclareChemDeprecated \Enthalpy \enthalpy \DeclareChemDeprecated \Entropy \entropy diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty index a2a94addd3e..03d7b33bd91 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 {2017/04/24} +\tl_const:Nn \c_chemmacros_date_tl {2017/06/13} \tl_const:Nn \c_chemmacros_version_major_number_tl {5} \tl_const:Nn \c_chemmacros_version_minor_number_tl {8} -\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 . @@ -56,8 +56,8 @@ % -------------------------------------------------------------------------- % set compatibility -\fp_new:N \l__chemmacros_compatibility_version_fp -\fp_set:Nn \l__chemmacros_compatibility_version_fp {\c_chemmacros_version_number_tl} +\tl_new:N \l__chemmacros_compatibility_version_tl +\tl_set_eq:NN \l__chemmacros_compatibility_version_tl \c_chemmacros_version_tl \keys_define:nn {chemmacros/compatibility} { @@ -68,10 +68,11 @@ {latest} {} } { - \fp_set:Nn \l__chemmacros_compatibility_version_fp - { \c_chemmacros_version_number_tl } + \tl_set_eq:NN + \l__chemmacros_compatibility_version_tl + \c_chemmacros_version_tl } - { \fp_set:Nn \l__chemmacros_compatibility_version_fp {#1} } , + { \tl_set:Nn \l__chemmacros_compatibility_version_tl {#1} } , unknown .code:n = \PassOptionsToPackage{\CurrentOption}{chemmacros4} \PassOptionsToPackage{\CurrentOption}{chemmacros5} @@ -81,36 +82,92 @@ % -------------------------------------------------------------------------- % compare version numbers -% #1: number +% #1: version % #2: relation -% #3: number +% #3: version % #4: true % #5: false \prg_new_conditional:Npnn \chemmacros_if_version:nnn #1#2#3 {p,T,F,TF} { - \fp_compare:nTF { floor(#1) = floor(#3) } + \fp_compare:nTF { - \fp_compare:nTF - { - ( \chemmacros_get_minor_version:f {#1} ) - #2 - ( \chemmacros_get_minor_version:f {#3} ) - } - { \prg_return_true: } - { \prg_return_false: } - } - { - \fp_compare:nTF { (#1) #2 (#3) } - { \prg_return_true: } - { \prg_return_false: } + ( + \chemmacros_get_major_version:n {#1} * 1e6 + + \chemmacros_get_minor_version:n {#1} * 1e3 + + 0 \chemmacros_get_subrelease:n {#1} + ) + #2 + ( + \chemmacros_get_major_version:n {#3} * 1e6 + + \chemmacros_get_minor_version:n {#3} * 1e3 + + 0 \chemmacros_get_subrelease:n {#3} + ) } + { \prg_return_true: } + { \prg_return_false: } } +\cs_generate_variant:Nn \chemmacros_if_version:nnnTF {fnf} \cs_new:Npn \__chemmacros_get_minor_version:w #1.#2.#3 \q_stop - { \tl_if_blank:nTF {#2} {0} {#2} } + { + \tl_if_blank:nTF {#2} {0} { + \tl_map_function:nN {#2} \__chemmacros_get_minor_number:n + } + } + \cs_new:Npn \chemmacros_get_minor_version:n #1 { \__chemmacros_get_minor_version:w #1.. \q_stop } -\cs_generate_variant:Nn \chemmacros_get_minor_version:n {f} + +\cs_new:Npn \__chemmacros_get_minor_number:n #1 + { + \str_case:nn {#1} + { + {0} {0} + {1} {1} + {2} {2} + {3} {3} + {4} {4} + {5} {5} + {6} {6} + {7} {7} + {8} {8} + {9} {9} + } + } + +\cs_new:Npn \__chemmacros_get_major_version:w #1.#2.#3 \q_stop + { \tl_if_blank:nTF {#1} {0} {#1} } + +\cs_new:Npn \chemmacros_get_major_version:n #1 + { \__chemmacros_get_major_version:w #1.. \q_stop } + +\cs_new:Npn \__chemmacros_get_subrelease:w #1.#2.#3 \q_stop + { + \tl_if_blank:nTF {#2} {0} { + \tl_map_function:nN {#2} \__chemmacros_get_subrelease_number:n + } + } + +\cs_new:Npn \chemmacros_get_subrelease:n #1 + { \__chemmacros_get_subrelease:w #1.. \q_stop } + +\cs_new:Npn \__chemmacros_get_subrelease_number:n #1 + { + \str_case:nnF {#1} + { + {0} {} + {1} {} + {2} {} + {3} {} + {4} {} + {5} {} + {6} {} + {7} {} + {8} {} + {9} {} + } + { \int_from_alph:n {#1} } + } % check compatibility % #1: relation @@ -119,8 +176,8 @@ % #4: false \prg_new_conditional:Npnn \chemmacros_if_compatibility:nn #1#2 {p,T,F,TF} { - \chemmacros_if_version:nnnTF - { \fp_to_decimal:N \l__chemmacros_compatibility_version_fp } + \chemmacros_if_version:fnfTF + { \l__chemmacros_compatibility_version_tl } {#1} {#2} { \prg_return_true: } @@ -129,13 +186,13 @@ \cs_generate_variant:Nn \chemmacros_if_compatibility:nnT {nV} % user checks: -\NewDocumentCommand \IfChemCompatibilityTF {mm+m+m} +\NewExpandableDocumentCommand \IfChemCompatibilityTF {mm+m+m} { \chemmacros_if_compatibility:nnTF {#1} {#2} {#3} {#4} } -\NewDocumentCommand \IfChemCompatibilityT {mm+m} +\NewExpandableDocumentCommand \IfChemCompatibilityT {mm+m} { \chemmacros_if_compatibility:nnT {#1} {#2} {#3} } -\NewDocumentCommand \IfChemCompatibilityF {mm+m} +\NewExpandableDocumentCommand \IfChemCompatibilityF {mm+m} { \chemmacros_if_compatibility:nnF {#1} {#2} {#3} } % -------------------------------------------------------------------------- @@ -147,14 +204,14 @@ { \chemmacros_if_compatibility:nnT {>=} {#1} {#2} } \cs_new_protected:Npn \ChemCompatibilityTo #1#2 \EndChemCompatibility - { \chemmacros_if_compatibility:nnT {<=} {#1} {#2} } + { \chemmacros_if_compatibility:nnT {<} {#1} {#2} } \cs_new_protected:Npn \ChemCompatibilityBetween #1#2#3 \EndChemCompatibility { \bool_if:nT { \chemmacros_if_compatibility_p:nn {>=} {#1} && - \chemmacros_if_compatibility_p:nn {<=} {#2} + \chemmacros_if_compatibility_p:nn {<} {#2} } {#3} } @@ -170,23 +227,24 @@ \msg_new:nnn {chemmacros} {too-high-compatibility} { You~ requested~ compatibility~ mode~ v #1~ while~ the~ current~ version~ - of~ chemmacros~ is~ v \c_chemmacros_version_number_tl .~ Falling~ back~ + of~ chemmacros~ is~ v \c_chemmacros_version_tl .~ Falling~ back~ to~ v \c_chemmacros_version_number_tl ! } \msg_new:nnn {chemmacros} {low-compatibility} { You~ requested~ compatibility~ mode~ v #1~ while~ the~ current~ version~ - of~ chemmacros~ is~ v \c_chemmacros_version_number_tl .~ Not~ all~ features~ - will~ be~ available! + of~ chemmacros~ is~ v \c_chemmacros_version_tl .~ Not~ all~ features~ + or~ fixes~ will~ be~ available! } % -------------------------------------------------------------------------- % let's see that the max number is the newest (=current) version -\chemmacros_if_compatibility:nnT {>} { \c_chemmacros_version_number_tl } +\chemmacros_if_compatibility:nnT {>} { \c_chemmacros_version_tl } { - \fp_set:Nn \l__chemmacros_compatibility_version_fp - { \c_chemmacros_version_number_tl } + \tl_set_eq:NN + \l__chemmacros_compatibility_version_tl + \c_chemmacros_version_tl } % -------------------------------------------------------------------------- @@ -194,14 +252,14 @@ \chemmacros_if_compatibility:nnT {<} {4.7} { \msg_warning:nnx {chemmacros} {too-low-compatibility} - { \fp_to_tl:N \l__chemmacros_compatibility_version_fp } + { \l__chemmacros_compatibility_version_tl } } % not the newest version: -\chemmacros_if_compatibility:nnT {<} { \c_chemmacros_version_number_tl } +\chemmacros_if_compatibility:nnT {<} { \c_chemmacros_version_tl } { \msg_warning:nnx {chemmacros} {low-compatibility} - { \fp_to_tl:N \l__chemmacros_compatibility_version_fp } + { \l__chemmacros_compatibility_version_tl } } % -------------------------------------------------------------------------- |