diff --git a/HISTORY b/HISTORY index 184030a..b746778 100644 --- a/HISTORY +++ b/HISTORY @@ -446,7 +446,8 @@ Version history which is why \ChemStyle is introduced - add load-time option `stop' which can prevent modules and styles from being loaded -2022/??/?? - version 6?? - enable giving translation keys per language +2022/03/05 - version 6.2 - enable giving translation keys per language (lang) - re-write translations module giving keys per language rather than vice versa + - fix issue with phases/sub=true (issue #49) diff --git a/README b/README index 6434c41..303cc4f 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -the CHEMMACROS package v6.1 2022/02/13 +the CHEMMACROS package v6.2 2022/03/05 comprehensive support for typesetting chemistry documents diff --git a/chemmacros.intro.statement b/chemmacros.intro.statement index 0a13458..ca4980b 100644 --- a/chemmacros.intro.statement +++ b/chemmacros.intro.statement @@ -1,5 +1,5 @@ % -------------------------------------------------------------------------- -% the CHEMMACROS package v6.1 2022/02/13 +% the CHEMMACROS package v6.2 2022/03/05 % % comprehensive support for typesetting chemistry documents % diff --git a/code/chemmacros.isotopes.code.tex b/code/chemmacros.isotopes.code.tex index ca50eaa..4999deb 100644 --- a/code/chemmacros.isotopes.code.tex +++ b/code/chemmacros.isotopes.code.tex @@ -23,7 +23,7 @@ { \tl_set:Nx #2 { \use:c { @elements@atom@name@num@ \str_lowercase:n {#1} } } } } } -\cs_generate_variant:Nn \chemmacros_get_atom_number:nN { V } +\cs_generate_variant:Nn \chemmacros_get_atom_number:nN {V} % #1: atomic number|element symbol|element name % #2: tl to store the result in @@ -64,7 +64,7 @@ { \prg_return_true: } { \prg_return_false: } } -\cs_generate_variant:Nn \chemmacros_check_isotope:nnF { V } +\cs_generate_variant:Nn \chemmacros_check_isotope:nnF {V} % #1: atomic number|element symbol|element name % #2: tl to store the result in @@ -81,7 +81,7 @@ { \seq_map_break: } } } -\cs_generate_variant:Nn \chemmacros_get_main_isotope:nN { V } +\cs_generate_variant:Nn \chemmacros_get_main_isotope:nN {V} % #1: atomic number|element symbol|element name % #2: seq to store the results in @@ -198,11 +198,9 @@ #1 } } -\cs_generate_variant:Nn \chemmacros_isotope_write:nnn { VnV , VVV , nnV , nVV } +\cs_generate_variant:Nn \chemmacros_isotope_write:nnn {VnV,VVV,nnV,nVV} -% TODO: option for the layout of the written isotope: ^{12}_6C vs C-12 - -\NewDocumentCommand \isotope { sm } +\NewDocumentCommand \isotope {sm} { \chemmacros_isotope:nn {#1} {#2} } % -------------------------------------------------------------------------- diff --git a/code/chemmacros.lang.code.tex b/code/chemmacros.lang.code.tex index b37fec6..fc0b005 100644 --- a/code/chemmacros.lang.code.tex +++ b/code/chemmacros.lang.code.tex @@ -1,4 +1,4 @@ -\ChemModule{lang}{2022/02/24 language settings for chemmacros} +\ChemModule{lang}{2022/03/05 language settings for chemmacros} \RequirePackage{translations} @@ -120,18 +120,28 @@ {#2} } +% #1: key +% #2: lang +% #3: translation \NewDocumentCommand \DeclareChemTranslations {mm} { \chemmacros_declare_translations:nn {#1} {#2} } \@onlypreamble \DeclareChemTranslations - + +% #1: key +% #2: csv list: { = , = } \NewDocumentCommand \DeclareChemTranslation {mmm} { \chemmacros_declare_translation:nnn {#1} {#2} {#3} } \@onlypreamble \DeclareChemTranslation +% #1: lang +% #2: csv list: { = , = } \NewDocumentCommand \AddChemTranslations {mm} { \chemmacros_add_translations:nn {#1} {#2} } \@onlypreamble \AddChemTranslations - + +% #1: lang +% #2: key +% #3: translation \NewDocumentCommand \AddChemTranslation {mmm} { \chemmacros_add_translation:nnn {#1} {#2} {#3} } \@onlypreamble \AddChemTranslation diff --git a/code/chemmacros.newman.code.tex b/code/chemmacros.newman.code.tex index bcb0e35..2bbcb4b 100644 --- a/code/chemmacros.newman.code.tex +++ b/code/chemmacros.newman.code.tex @@ -144,7 +144,7 @@ { #2 } ; \group_end: } -\cs_generate_variant:Nn \chemmacros_newman_back_node:nn { nf } +\cs_generate_variant:Nn \chemmacros_newman_back_node:nn {nf} % place front nodes: \cs_new_protected:Npn \chemmacros_newman_front_node:nn #1#2 @@ -175,7 +175,7 @@ ) { #2 } ; } -\cs_generate_variant:Nn \chemmacros_newman_front_node:nn { nf } +\cs_generate_variant:Nn \chemmacros_newman_front_node:nn {nf} % -------------------------------------------------------------------------- \ChemModuleEnd diff --git a/code/chemmacros.phases.code.tex b/code/chemmacros.phases.code.tex index 5174910..1a27b8d 100644 --- a/code/chemmacros.phases.code.tex +++ b/code/chemmacros.phases.code.tex @@ -1,4 +1,4 @@ -\ChemModule{phases}{2020/11/29 phase descriptors} +\ChemModule{phases}{2022/03/03 phase descriptors} \bool_new:N \l__chemmacros_phases_sub_bool \dim_new:N \l__chemmacros_phases_space_dim diff --git a/code/chemmacros.reactions.code.tex b/code/chemmacros.reactions.code.tex index abb7ec3..a33b953 100644 --- a/code/chemmacros.reactions.code.tex +++ b/code/chemmacros.reactions.code.tex @@ -246,7 +246,7 @@ #3 \end{#1} } -\cs_generate_variant:Nn \__chemmacros_reaction_write:nnn { nnV } +\cs_generate_variant:Nn \__chemmacros_reaction_write:nnn {nnV} \chemmacros_define_keys:nn {reactions} { diff --git a/code/chemmacros.spectroscopy.code.tex b/code/chemmacros.spectroscopy.code.tex index ca68988..2e4e95e 100644 --- a/code/chemmacros.spectroscopy.code.tex +++ b/code/chemmacros.spectroscopy.code.tex @@ -68,7 +68,7 @@ \tl_gclear:N \g__chemmacros_nmr_element_coupled_tl } } -\cs_generate_variant:Nn \__chemmacros_nmr_nucleus:nn { VV } +\cs_generate_variant:Nn \__chemmacros_nmr_nucleus:nn {VV} \cs_new_protected:Npn \__chemmacros_nmr_nucleus:w #1,#2 \q_stop { @@ -120,7 +120,7 @@ \group_end: } -\cs_generate_variant:Nn \__chemmacros_nmr_base:nn { VV } +\cs_generate_variant:Nn \__chemmacros_nmr_base:nn {VV} \cs_new_protected:Npn \__chemmacros_nmr_frequency:n #1 { diff --git a/code/chemmacros.start.code.tex b/code/chemmacros.start.code.tex index b778c9a..c8d37d5 100644 --- a/code/chemmacros.start.code.tex +++ b/code/chemmacros.start.code.tex @@ -7,9 +7,9 @@ % -------------------------------------------------------------------------- % package information: -\tl_const:Nn \c_chemmacros_date_tl {2022/02/13} +\tl_const:Nn \c_chemmacros_date_tl {2022/03/05} \tl_const:Nn \c_chemmacros_version_major_number_tl {6} -\tl_const:Nn \c_chemmacros_version_minor_number_tl {1} +\tl_const:Nn \c_chemmacros_version_minor_number_tl {2} \tl_const:Nn \c_chemmacros_version_subrelease_tl {} \tl_const:Nx \c_chemmacros_version_number_tl { diff --git a/code/chemmacros.sty b/code/chemmacros.sty index 1bb6c30..f9b0bf5 100644 --- a/code/chemmacros.sty +++ b/code/chemmacros.sty @@ -1,5 +1,5 @@ % -------------------------------------------------------------------------- -% the CHEMMACROS package v6.1 2022/02/13 +% the CHEMMACROS package v6.2 2022/03/05 % % comprehensive support for typesetting chemistry documents % @@ -34,9 +34,9 @@ % -------------------------------------------------------------------------- % package information: -\tl_const:Nn \c_chemmacros_date_tl {2022/02/13} +\tl_const:Nn \c_chemmacros_date_tl {2022/03/05} \tl_const:Nn \c_chemmacros_version_major_number_tl {6} -\tl_const:Nn \c_chemmacros_version_minor_number_tl {1} +\tl_const:Nn \c_chemmacros_version_minor_number_tl {2} \tl_const:Nn \c_chemmacros_version_subrelease_tl {} \tl_const:Nx \c_chemmacros_version_number_tl { @@ -1038,7 +1038,7 @@ % -------------------------------------------------------------------------- \ChemModuleEnd -\ChemModule{lang}{2022/02/24 language settings for chemmacros} +\ChemModule{lang}{2022/03/05 language settings for chemmacros} \RequirePackage{translations} @@ -1160,18 +1160,28 @@ {#2} } +% #1: key +% #2: lang +% #3: translation \NewDocumentCommand \DeclareChemTranslations {mm} { \chemmacros_declare_translations:nn {#1} {#2} } \@onlypreamble \DeclareChemTranslations - + +% #1: key +% #2: csv list: { = , = } \NewDocumentCommand \DeclareChemTranslation {mmm} { \chemmacros_declare_translation:nnn {#1} {#2} {#3} } \@onlypreamble \DeclareChemTranslation +% #1: lang +% #2: csv list: { = , = } \NewDocumentCommand \AddChemTranslations {mm} { \chemmacros_add_translations:nn {#1} {#2} } \@onlypreamble \AddChemTranslations - + +% #1: lang +% #2: key +% #3: translation \NewDocumentCommand \AddChemTranslation {mmm} { \chemmacros_add_translation:nnn {#1} {#2} {#3} } \@onlypreamble \AddChemTranslation @@ -1819,7 +1829,7 @@ % -------------------------------------------------------------------------- \ChemModuleEnd -\ChemModule{phases}{2020/11/29 phase descriptors} +\ChemModule{phases}{2022/03/03 phase descriptors} \bool_new:N \l__chemmacros_phases_sub_bool \dim_new:N \l__chemmacros_phases_space_dim @@ -2767,7 +2777,7 @@ { \tl_set:Nx #2 { \use:c { @elements@atom@name@num@ \str_lowercase:n {#1} } } } } } -\cs_generate_variant:Nn \chemmacros_get_atom_number:nN { V } +\cs_generate_variant:Nn \chemmacros_get_atom_number:nN {V} % #1: atomic number|element symbol|element name % #2: tl to store the result in @@ -2808,7 +2818,7 @@ { \prg_return_true: } { \prg_return_false: } } -\cs_generate_variant:Nn \chemmacros_check_isotope:nnF { V } +\cs_generate_variant:Nn \chemmacros_check_isotope:nnF {V} % #1: atomic number|element symbol|element name % #2: tl to store the result in @@ -2825,7 +2835,7 @@ { \seq_map_break: } } } -\cs_generate_variant:Nn \chemmacros_get_main_isotope:nN { V } +\cs_generate_variant:Nn \chemmacros_get_main_isotope:nN {V} % #1: atomic number|element symbol|element name % #2: seq to store the results in @@ -2942,11 +2952,9 @@ #1 } } -\cs_generate_variant:Nn \chemmacros_isotope_write:nnn { VnV , VVV , nnV , nVV } - -% TODO: option for the layout of the written isotope: ^{12}_6C vs C-12 +\cs_generate_variant:Nn \chemmacros_isotope_write:nnn {VnV,VVV,nnV,nVV} -\NewDocumentCommand \isotope { sm } +\NewDocumentCommand \isotope {sm} { \chemmacros_isotope:nn {#1} {#2} } % -------------------------------------------------------------------------- @@ -3236,7 +3244,7 @@ { #2 } ; \group_end: } -\cs_generate_variant:Nn \chemmacros_newman_back_node:nn { nf } +\cs_generate_variant:Nn \chemmacros_newman_back_node:nn {nf} % place front nodes: \cs_new_protected:Npn \chemmacros_newman_front_node:nn #1#2 @@ -3267,7 +3275,7 @@ ) { #2 } ; } -\cs_generate_variant:Nn \chemmacros_newman_front_node:nn { nf } +\cs_generate_variant:Nn \chemmacros_newman_front_node:nn {nf} % -------------------------------------------------------------------------- \ChemModuleEnd @@ -4199,7 +4207,7 @@ #3 \end{#1} } -\cs_generate_variant:Nn \__chemmacros_reaction_write:nnn { nnV } +\cs_generate_variant:Nn \__chemmacros_reaction_write:nnn {nnV} \chemmacros_define_keys:nn {reactions} { @@ -5086,7 +5094,7 @@ \tl_gclear:N \g__chemmacros_nmr_element_coupled_tl } } -\cs_generate_variant:Nn \__chemmacros_nmr_nucleus:nn { VV } +\cs_generate_variant:Nn \__chemmacros_nmr_nucleus:nn {VV} \cs_new_protected:Npn \__chemmacros_nmr_nucleus:w #1,#2 \q_stop { @@ -5138,7 +5146,7 @@ \group_end: } -\cs_generate_variant:Nn \__chemmacros_nmr_base:nn { VV } +\cs_generate_variant:Nn \__chemmacros_nmr_base:nn {VV} \cs_new_protected:Npn \__chemmacros_nmr_frequency:n #1 { @@ -5535,7 +5543,7 @@ } \group_end: } -\cs_generate_variant:Nn \chemmacros_state:nnnnnn { nVVVVV } +\cs_generate_variant:Nn \chemmacros_state:nnnnnn {nVVVVV} \exp_args:NNe \NewDocumentCommand \state { O{}e{\char_generate:nn {`_}{8}^}me{\char_generate:nn {`_}{8}^} } diff --git a/code/chemmacros.thermodynamics.code.tex b/code/chemmacros.thermodynamics.code.tex index 571aca6..a75bf95 100644 --- a/code/chemmacros.thermodynamics.code.tex +++ b/code/chemmacros.thermodynamics.code.tex @@ -57,7 +57,7 @@ } \group_end: } -\cs_generate_variant:Nn \chemmacros_state:nnnnnn { nVVVVV } +\cs_generate_variant:Nn \chemmacros_state:nnnnnn {nVVVVV} \exp_args:NNe \NewDocumentCommand \state { O{}e{\char_generate:nn {`_}{8}^}me{\char_generate:nn {`_}{8}^} } diff --git a/doc/chemmacros-manual.pdf b/doc/chemmacros-manual.pdf index b23770c..8e18c20 100644 Binary files a/doc/chemmacros-manual.pdf and b/doc/chemmacros-manual.pdf differ diff --git a/doc/chemmacros.manual.cls b/doc/chemmacros.manual.cls index 1f36227..159ad0e 100644 --- a/doc/chemmacros.manual.cls +++ b/doc/chemmacros.manual.cls @@ -1,4 +1,4 @@ -\ProvidesClass{chemmacros-manual}[2022/02/13] +\ProvidesClass{chemmacros-manual}[2022/03/05] \LoadClass[load-preamble,add-index]{cnltx-doc} \RequirePackage{imakeidx} @@ -533,5 +533,6 @@ \chemmacros@add@version{2022-01-16}{6.0} \chemmacros@add@version{2022-01-18}{6.0a} \chemmacros@add@version{2022-02-13}{6.1} +\chemmacros@add@version{2022-03-05}{6.2} \endinput diff --git a/doc/chemmacros.manual.tex b/doc/chemmacros.manual.tex index bc76c8b..ba6eae3 100644 --- a/doc/chemmacros.manual.tex +++ b/doc/chemmacros.manual.tex @@ -278,7 +278,7 @@ \subsection{Upgrading from version $5.x$} \option{minimal} allows to load \chemmacros\ with smallest subset necessary. Then additional modules can be added with the \option{modules}. - \item A new module \module{reactants} has been added, thanks to \leandriis. + \item A new module \module{reactants} has been added, thanks to \leandriis! \end{itemize} \part{Main Modules}\label{part:main-modules} @@ -3323,11 +3323,6 @@ \subsection{Available Translation Keys}\label{sec:avail-transl-keys} find that a translation for your language is missing you can provide it in the preamble: \begin{commands} - % \command{DeclareTranslation}[\marg{language}\marg{key}\marg{translation}] - % Defines a translation of key \meta{key} for the language \meta{language}. - % No error will be raised if a translation of \meta{key} already exists. - % This command can only be used in the preamble and is defined by the - % \pkg{translations} package. \command{DeclareChemTranslation}[\marg{key}\marg{language}\marg{translation}] \sinceversion{5.6}A command which makes an abstraction from the \pkg{translations} package. It should be used in documents for adding @@ -3339,6 +3334,15 @@ \subsection{Available Translation Keys}\label{sec:avail-transl-keys} used by document authors as well, of course. It gets a csv list of key\slash value pairs of translations. This command can only be used in the preamble. + \command{AddChemTranslation}[\marg{language}\marg{key}\marg{translation}] + \sinceversion{6.2}Basically the same as \cs{DeclareChemTranslation} but + with focus on the language instead of the key and thus has a different + argument order. This command can only be used in the preamble. + \command{AddChemTranslations}[\marg{languagen}\Marg{\meta{key} = \meta{translation}}] + \sinceversion{6.2}Basically the same as \cs{DeclareChemTranslations} but + with focus on the language instead of the key. It lets you define the + translations of several keys for one language in one go. This command can + only be used in the preamble. \end{commands} If you send me an email (see section~\vref{sec:sugg-bug-reports}) with the translations for your language I'll gladly add them to the next release of