summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/HISTORY5
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/README2
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.pdfbin1017922 -> 1018644 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.tex18
-rw-r--r--Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty360
5 files changed, 182 insertions, 203 deletions
diff --git a/Master/texmf-dist/doc/latex/chemmacros/HISTORY b/Master/texmf-dist/doc/latex/chemmacros/HISTORY
index bad8cce61ad..b746778d8b7 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/HISTORY
+++ b/Master/texmf-dist/doc/latex/chemmacros/HISTORY
@@ -446,3 +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/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/Master/texmf-dist/doc/latex/chemmacros/README b/Master/texmf-dist/doc/latex/chemmacros/README
index 6434c4135a3..303cc4f8548 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/README
+++ b/Master/texmf-dist/doc/latex/chemmacros/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/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.pdf b/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.pdf
index b23770c8184..8e18c209357 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.pdf
+++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.tex b/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.tex
index c099679864e..08954ccb2f3 100644
--- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.tex
+++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros-manual.tex
@@ -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
%
@@ -305,7 +305,7 @@ important and \emph{breaking} differences:
\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}
@@ -3350,11 +3350,6 @@ is provided. For a few keys also other translations are provided. If you
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
@@ -3366,6 +3361,15 @@ preamble:
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
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
index 649aed58b64..f9b0bf50cde 100644
--- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
+++ b/Master/texmf-dist/tex/latex/chemmacros/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
%
@@ -26,13 +26,17 @@
% The Current Maintainers of this work are Clemens Niederberger and Sonja K.
% --------------------------------------------------------------------------
\RequirePackage {l3keys2e}
+
+\DeclareRelease {v4} {2015-02-08} {chemmacros-2015-02-08.sty}
+\DeclareRelease {v5} {2020-03-07} {chemmacros-2020-03-07.sty}
+
\ExplSyntaxOn
% --------------------------------------------------------------------------
% 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
{
@@ -52,6 +56,7 @@
{\c_chemmacros_date_tl}
{\c_chemmacros_version_tl}
{\c_chemmacros_info_tl \c_space_tl (CN~ &~ SK)}
+\DeclareCurrentRelease{}{\c_chemmacros_date_tl}
% --------------------------------------------------------------------------
% variants of kernel functions:
@@ -1033,7 +1038,7 @@
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{lang}{2022/01/18 language settings for chemmacros}
+\ChemModule{lang}{2022/03/05 language settings for chemmacros}
\RequirePackage{translations}
@@ -1046,6 +1051,18 @@
Otherwise~ contact~ the~ author~ and~ he'll~ probably~ add~ your~ language.
}
+\msg_new:nnn {chemmacros} {missing-translation}
+ {
+ The~ tranlation~ for~ key~ `#1'~ and~ language~ `#2'~ is~ missing~
+ \mgs_context_line:
+ }
+
+\msg_new:nnn {chemmacros} {missing-translation-alt}
+ {
+ The~ tranlation~ for~ key~ `#2'~ and~ language~ `#1'~ is~ missing~
+ \mgs_context_line:
+ }
+
% --------------------------------------------------------------------------
% language settings:
\bool_new:N \l__chemmacros_language_auto_bool
@@ -1104,19 +1121,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} }
- \tl_set:Nx \l__chemmacros_tmpb_tl { \tl_trim_spaces:n {#3} }
- \use:x
- {
- \chemmacros_declare_translation:nnn
- { \exp_not:n {#1} }
- { \exp_not:V \l__chemmacros_tmpa_tl }
- { \exp_not:V \l__chemmacros_tmpb_tl }
- }
- }
-
% #1: key
% #2: lang
% #3: translation
@@ -1134,18 +1138,55 @@
% #2: csv list: { <lang1> = <translation1> , <lang2> = <translation2> }
\cs_new_protected:Npn \chemmacros_declare_translations:nn #1#2
{
- \clist_map_inline:nn {#2}
- { \__chemmacros_declare_translation:nw {#1} ##1 \q_stop }
+ \keyval_parse:nnn
+ { \msg_warning:nnnn {chemmacros} {missing-translation} {#1} }
+ { \chemmacros_declare_translation:nnn {#1} }
+ {#2}
+ }
+
+% #1: lang
+% #2: key
+% #3: translation
+\cs_new_protected:Npn \chemmacros_add_translation:nnn #1#2#3
+ { \chemmacros_declare_translation:nnn {#2} {#1} {#3} }
+
+% #1: language
+% #2: csv list: { <key1> = <translation1> , <key2> = <translation2> }
+\cs_new_protected:Npn \chemmacros_add_translations:nn #1#2
+ {
+ \keyval_parse:nnn
+ { \msg_warning:nnnn {chemmacros} {missing-translation-alt} {#1} }
+ { \chemmacros_add_translation:nnn {#1} }
+ {#2}
}
+% #1: key
+% #2: lang
+% #3: translation
\NewDocumentCommand \DeclareChemTranslations {mm}
{ \chemmacros_declare_translations:nn {#1} {#2} }
\@onlypreamble \DeclareChemTranslations
-
+
+% #1: key
+% #2: csv list: { <lang1> = <translation1> , <lang2> = <translation2> }
\NewDocumentCommand \DeclareChemTranslation {mmm}
{ \chemmacros_declare_translation:nnn {#1} {#2} {#3} }
\@onlypreamble \DeclareChemTranslation
+% #1: lang
+% #2: csv list: { <key1> = <translation1> , <key2> = <translation2> }
+\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
+
+% --------------------------------------------------------------------------
\cs_new:Npn \__chemmacros_parse_translate_list_entry:nnn #1#2#3 {}
\cs_new_protected:Npn \__chemmacros_parse_translate_list_entry:www #1(#2)\q_mark#3\q_stop
@@ -1788,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
@@ -1828,7 +1869,7 @@
{
\mode_leave_vertical:
\bool_if:NTF \l__chemmacros_phases_sub_bool
- { \chemmacros_formula:n { {}_{(#1)} } }
+ { \ensuremath { \c_math_subscript_token { \chemmacros_text:n { (#1) } } } }
{
\skip_horizontal:N \l__chemmacros_phases_space_dim
\chemmacros_text:n { (#1) }
@@ -2736,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
@@ -2777,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
@@ -2794,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
@@ -2911,11 +2952,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} }
% --------------------------------------------------------------------------
@@ -3205,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
@@ -3236,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
@@ -4168,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}
{
@@ -5055,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
{
@@ -5107,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
{
@@ -5504,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}^} }
@@ -6773,172 +6812,103 @@
% --------------------------------------------------------------------------
\ChemModuleEnd
-\ChemModule{translations}{2022/01/26 translations for defined keys at one place}
-
-% --------------------------------------------------------------------------
-\chemmacros_declare_translations:nn {K-acid}
- {
- German = \mathrm {s} ,
- Danish = \mathrm {s} ,
- Dutch = \mathrm {z}
- }
-
-\chemmacros_declare_translations:nn {K-water}
- { Danish = \mathrm {v} }
-
-% --------------------------------------------------------------------------
-\chemmacros_declare_translations:nn {phase-sld}
- {
- fallback = s ,
- German = f
- }
-
-\chemmacros_declare_translations:nn {phase-lqd}
- {
- fallback = l ,
- German = f\/l
- }
-
-\chemmacros_declare_translations:nn {phase-gas}
- { fallback = g }
-
-\chemmacros_declare_translations:nn {phase-aq}
- { fallback = aq }
-
-% --------------------------------------------------------------------------
-\chemmacros_declare_translations:nn {solution}
- {
- fallback = solution~ in ,
- English = solution~ in ,
- German = L\"osung~ in ,
- }
+\ChemModule{translations}{2022/02/24 translations for defined keys at one place}
+
+\chemmacros_add_translations:nn {fallback} {
+ phase-sld = s ,
+ phase-lqd = l ,
+ phase-gas = g ,
+ phase-aq = aq ,
+ solution = solution~ in ,
+ list-of-reactions = List~ of~ Reactions ,
+ reaction = reaction ,
+ reactions = reactions ,
+ Reaction = Reaction ,
+ Reactions = Reactions ,
+ scheme-name = Scheme ,
+ scheme-list = List~ of~ Schemes ,
+ scheme = scheme ,
+ schemes = schemes ,
+ Scheme = Scheme ,
+ Schemes = Schemes
+}
-% --------------------------------------------------------------------------
-\chemmacros_declare_translations:nn {list-of-reactions}
- {
- fallback = List~ of~ Reactions ,
- English = List~ of~ Reactions ,
- German = Reaktionsverzeichnis ,
- Italian = Elenco~ delle~ reazioni ,
- French = Table~ des~ r\'{e}actions ,
- Dutch = Lijst~ van~ reacties ,
- Norwegian = Reaksjonsliste ,
- Nynorsk = Reaksjonsliste ,
- Danish = Reaktionsliste
- }
-
-\chemmacros_declare_translations:nn {reaction}
- {
- fallback = reaction ,
- English = reaction ,
- German = Reaktion ,
- Italian = reazione ,
- French = r\'{e}action ,
- Dutch = reactie ,
- Norwegian = reaksjon ,
- Nynorsk = reaksjon ,
- Danish = reaktion
- }
-
-\chemmacros_declare_translations:nn {reactions}
- {
- fallback = reactions ,
- English = reactions ,
- German = Reaktionen ,
- Italian = reazioni ,
- French = r\'{e}actions ,
- Dutch = reacties ,
- Norwegian = reaksjoner ,
- Nynorsk = reaksjonar ,
- Danish = reaktioner
- }
-
-\chemmacros_declare_translations:nn {Reaction}
- {
- fallback = Reaction ,
- English = Reaction ,
- German = Reaktion ,
- Italian = Reazione ,
- French = R\'{e}action ,
- Dutch = Reactie ,
- Norwegian = Reaksjon ,
- Nynorsk = Reaksjon ,
- Danish = Reaktion
- }
-
-\chemmacros_declare_translations:nn {Reactions}
- {
- fallback = Reactions ,
- English = Reactions ,
- German = Reaktionen ,
- Italian = Reazioni ,
- French = R\'{e}actions ,
- Dutch = Reacties ,
- Norwegian = Reaksjoner ,
- Nynorsk = Reaksjonar ,
- Danish = Reaktioner
- }
+\chemmacros_add_translations:nn {German} {
+ K-acid = \mathrm {s} ,
+ phase-sld = f ,
+ phase-lqd = f\/l ,
+ solution = L\"osung~ in ,
+ list-of-reactions = Reaktionsverzeichnis ,
+ reaction = Reaktion ,
+ reactions = Reaktionen ,
+ Reaction = Reaktion ,
+ Reactions = Reaktionen ,
+ scheme-name = Schema ,
+ scheme-list = Verzeichnis~ der~ Schemata ,
+ scheme = Schema ,
+ schemes = Schemata ,
+ Scheme = Schema ,
+ Schemes = Schemata
+}
-% --------------------------------------------------------------------------
-\chemmacros_declare_translations:nn {scheme-name}
- {
- fallback = Scheme ,
- English = Scheme ,
- German = Schema ,
- Norwegian = Skjema ,
- Nynorsk = Skjema ,
- Danish = Skema
- }
+\chemmacros_add_translations:nn {Danish} {
+ K-acid = \mathrm {s} ,
+ K-water = \mathrm {v} ,
+ list-of-reactions = Reaktionsliste ,
+ reaction = reaktion ,
+ reactions = reaktioner ,
+ Reaction = Reaktion ,
+ Reactions = Reaktioner ,
+ scheme-name = Skema ,
+ scheme-list = Skemaliste ,
+ scheme = skema ,
+ schemes = skemaer ,
+ Scheme = Skema ,
+ Schemes = Skemaer
+}
-\chemmacros_declare_translations:nn {scheme-list}
- {
- fallback = List~ of~ Schemes ,
- English = List~ of~ Schemes ,
- German = Verzeichnis~ der~ Schemata ,
- Norwegian = Skjemaliste ,
- Nynorsk = Skjemaliste ,
- Danish = Skemaliste
- }
+\chemmacros_add_translations:nn {Dutch} {
+ K-acid = \mathrm {z} ,
+ list-of-reactions = Lijst~ van~ reacties ,
+ reaction = reactie ,
+ reactions = reacties ,
+ Reaction = Reactie ,
+ Reactions = Reacties
+}
-\chemmacros_declare_translations:nn {scheme}
- {
- fallback = scheme ,
- English = scheme ,
- German = Schema ,
- Norwegian = skjema ,
- Nynorsk = skjema ,
- Danish = skema
- }
+\chemmacros_add_translations:nn {Italian} {
+ list-of-reactions = Elenco~ delle~ reazioni ,
+ reaction = reazione ,
+ reactions = reazioni ,
+ Reaction = Reazione ,
+ Reactions = Reazioni
+}
-\chemmacros_declare_translations:nn {Scheme}
- {
- fallback = Scheme ,
- English = Scheme ,
- German = Schema ,
- Norwegian = Skjema ,
- Nynorsk = Skjema ,
- Danish = Skema
- }
+\chemmacros_add_translations:nn {French} {
+ list-of-reactions = Table~ des~ r\'{e}actions ,
+ reaction = r\'{e}action ,
+ reactions = r\'{e}actions ,
+ Reaction = R\'{e}action ,
+ Reactions = R\'{e}actions
+}
-\chemmacros_declare_translations:nn {schemes}
- {
- fallback = schemes ,
- English = schemes ,
- German = Schemata ,
- Norwegian = skjema ,
- Nynorsk = skjema ,
- Danish = skemaer
- }
+\chemmacros_add_translations:nn {Norwegian} {
+ list-of-reactions = Reaksjonsliste ,
+ reaction = reaksjon ,
+ reactions = reaksjoner ,
+ Reaction = Reaksjon ,
+ Reactions = Reaksjoner ,
+ scheme-name = Skjema ,
+ scheme-list = Skjemaliste ,
+ scheme = skjema ,
+ schemes = skjema ,
+ Scheme = Skjema ,
+ Schemes = Skjema
+}
-\chemmacros_declare_translations:nn {Schemes}
- {
- fallback = Schemes ,
- English = Schemes ,
- German = Schemata ,
- Norwegian = Skjema ,
- Nynorsk = Skjema ,
- Danish = Skemaer
- }
+\chemmacros_add_translations:nn {Nynorsk} {
+ reactions = reaksjonar ,
+ Reactions = Reaksjonar
+}
-% --------------------------------------------------------------------------
\ChemModuleEnd