From 36d552979c032d6ef452a4ca9a2fa8a1053f85a6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 9 Jun 2016 22:52:19 +0000 Subject: chemmacros (8jun16) git-svn-id: svn://tug.org/texlive/trunk@41327 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/chemmacros/README | 2 +- .../doc/latex/chemmacros/chemmacros_en.pdf | Bin 1010753 -> 1012114 bytes .../doc/latex/chemmacros/chemmacros_en.tex | 160 ++++++++++---------- .../chemmacros.module.acid-base.code.tex | 23 +-- .../chemmacros/chemmacros.module.base.code.tex | 2 +- .../chemmacros.module.chemformula.code.tex | 2 +- .../chemmacros.module.errorcheck.code.tex | 15 +- .../chemmacros/chemmacros.module.lang.code.tex | 55 +++++-- .../chemmacros.module.nomenclature.code.tex | 168 +++++++++++++++------ .../chemmacros/chemmacros.module.orbital.code.tex | 1 + .../chemmacros/chemmacros.module.phases.code.tex | 32 ++-- .../chemmacros/chemmacros.module.polymers.code.tex | 2 +- .../chemmacros.module.reactions.code.tex | 8 +- .../chemmacros/chemmacros.module.redox.code.tex | 2 +- .../chemmacros/chemmacros.module.scheme.code.tex | 2 +- .../chemmacros.module.spectroscopy.code.tex | 2 +- .../chemmacros/chemmacros.module.tikz.code.tex | 2 +- .../texmf-dist/tex/latex/chemmacros/chemmacros.sty | 18 ++- 18 files changed, 314 insertions(+), 182 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/chemmacros/README b/Master/texmf-dist/doc/latex/chemmacros/README index 04b8b5ea045..9e7ca8c7fa8 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.6a 2016/05/04 +the CHEMMACROS package v5.7a 2016/06/08 comprehensive support for typesetting chemistry documents diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.pdf b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.pdf index f3bf45d6fc4..4e116ed08e5 100644 Binary files a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.pdf and b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.pdf differ diff --git a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.tex b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.tex index 48a556774db..fc0f9b9e606 100644 --- a/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.tex +++ b/Master/texmf-dist/doc/latex/chemmacros/chemmacros_en.tex @@ -127,7 +127,9 @@ makeindex-setup = { columns = 2 , columnsep = 1em } } -\usepackage{chemfig,booktabs,cancel,varioref,csquotes} +\usepackage{booktabs,array,longtable} + +\usepackage{chemfig,cancel,varioref,csquotes} \usepackage[ a4paper, @@ -701,7 +703,7 @@ In modules one can try adding code for a certain version or range of versions: \command{ChemCompatibilityBetween}[\marg{num1}\marg{num2} \meta{code} \cs{EndChemCompatibility}] Leaves \meta{code} in the input stream if the compatibility version $x$ - given by \option{compatibility} lies between \meta{num2} and \meta{num2} + given by \option{compatibility} lies between \meta{num1} and \meta{num2} ($\text{\meta{num1}}\leq x\leq\text{\meta{num2}}$). \command{EndChemCompatibility} This macro \emph{must} end each of the \cs*{ChemCompatibility\ldots} @@ -1329,21 +1331,34 @@ existing ones: \subsubsection{Latin Phrases} -The package \pkg{chemstyle}~\cite{pkg:chemstyle} provides the command -\cs{latin} to typeset common latin phrases in a consistent way. \chemmacros\ -defines a similar \cs{latin} only if \pkg{chemstyle} has \emph{not} been -loaded and additionally provides these commands: -\begin{center} - \cs{insitu} \insitu \quad - \cs{abinitio} \abinitio \quad - \cs{invacuo} \invacuo -\end{center} +\chemmacros\ provides a command for typesetting latin phrases: +\begin{commands} + \command{latin}[\oarg{options}\marg{phrase}] + Typesets \meta{phrase} according to the option \option{format} described + below. + \command{insitu}[\quad\insitu] + \command{invacuo}[\quad\invacuo] + \command{abinitio}[\quad\abinitio] +\end{commands} + +If you additionally load \pkg{chemstyle}~\cite{pkg:chemstyle} said package +will \emph{not} define its own \cs{latin}. -\emph{If the package \pkg{chemstyle} has been loaded they are defined using -\pkg{chemstyle}'s \cs{latin} command. This means that then the appearance -depends on \pkg{chemstyle}'s option \code{abbremph}.} +% The package \pkg{chemstyle}~\cite{pkg:chemstyle} provides the command +% \cs{latin} to typeset common latin phrases in a consistent way. \chemmacros\ +% defines a similar \cs{latin} only if \pkg{chemstyle} has \emph{not} been +% loaded and additionally provides these commands: +% \begin{center} +% \cs{insitu} \insitu \quad +% \cs{abinitio} \abinitio \quad +% \cs{invacuo} \invacuo +% \end{center} -The commands are defined through +% \emph{If the package \pkg{chemstyle} has been loaded they are defined using +% \pkg{chemstyle}'s \cs{latin} command. This means that then the appearance +% depends on \pkg{chemstyle}'s option \code{abbremph}.} + +The last three commands mentioned above are defined through \begin{commands} \command{NewChemLatin}[\marg{cs}\marg{phrase}] Define a new latin phrase. Gives an error if \meta{cs} already exists. @@ -1358,11 +1373,10 @@ The commands are defined through \begin{example}[side-by-side] \NewChemLatin\ltn{latin text}\ltn \end{example} -If you have \emph{not} loaded \pkg{chemstyle} you can change the appearance -with this option: +You can change the appearance with this option: \begin{options} - \keyval{format}{definition}\Module{nomenclature}\Default{\cs*{itshape}} - Set the format of the latin phrases. + \keyval{format}{definition}\Module{nomenclature}\Default{\cs*{emph}} + \changedversion{5.7}Sets the format for the latin phrases. \end{options} \subsection{The \chemmodule*{particles} Module}\label{sec:particles-module} @@ -1904,7 +1918,7 @@ For further details on mappings please refer to \chemgreek's manual. The \chemmodule{lang} module provides language support for \chemmacros. It loads the package \pkg{translations}~\cite{pkg:translations}. -\subsubsection{Information For Users} +\subsubsection{Information For Users}\label{sec:information-users} This module defines the following option: \begin{options} @@ -1925,22 +1939,25 @@ translation keys are listed in section~\vref{sec:avail-transl-keys}. \subsubsection{Available Translation Keys}\label{sec:avail-transl-keys} -Table~\vref{tab:translation-keys} lists (almost) all keys which are predefined -in \chemmacros. \emph{Some of the translations have changed in - version~5.6\changedversion{5.6}.} The \chemmodule{lang} doesn't provide the -translations themselves -- they are provided by the corresponding modules. A -translation key is a key which is understood by the \pkg{translations} package -and its commands like \cs*{GetTranslation}. For each key at least the English -fallback translation is provided, for most also the German translation 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 +Table~\vref{tab:translation-keys} lists all predefined translations of the +available keys. \emph{Some of the translations have changed in + version~5.6\changedversion{5.6}.} The \chemmodule{lang} module doesn't +provide the translations themselves -- they are provided by the corresponding +modules. A translation key is a unique string\footnote{That is, a string + using the definition for strings used for expl3, i.e., converted to a series + of category code~12 characters..} of characters. Each key is used to +identify a replacement text which depends on the current language or the +language set through the \option{language} option. For each key at least the +English fallback translation is provided, for most also the German translation +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{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{language}\marg{key}\marg{translation}] \sinceversion{5.6}A command which makes an abstraction from the \pkg{translations} package. It should be used in documents for adding @@ -1952,58 +1969,43 @@ 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. - \explcommand{chemmacros_declare_translation:nnn}[\marg{language}\marg{key}% - \marg{translation}] - The expl3 version of \cs{DeclareChemTranslation}. - \explcommand{chemmacros_declare_translations:nn}[\marg{key}\Marg{\meta{language} = - \meta{translation}}] - The expl3 version of \cs{DeclareChemTranslations}. \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 \chemmacros! -\begin{table} - \centering - \caption{Translation keys predefined by \chemmacros.} - \label{tab:translation-keys} - \NewDocumentCommand\showtranslation{mm}{% - \SaveTranslationFor\tmp{#1}{#2}% - \code{\detokenize\expandafter{\tmp}}% - } - \NewDocumentCommand\showtranslations{m}{ - \code{#1} & - \showtranslation{fallback}{#1} & - \showtranslation{german}{#1} - } - \begin{tabular}{lll} +\emph{Please do not use \pkg{translations}' \cs{DeclareTranslation} for + declaring translations.} + +\ForAllChemTranslationsDo{ + \appto\chemtranslationtable{\texttt{#1} & #2 & \texttt{\detokenize{#3}} \\} +} + +\begin{longtable}{lll} + \caption{Translation keys predefined by \chemmacros\ (except + \code{phase-aqi}, \code{phase-cd} and \code{phase-lc} which were defined + in this document).} + \label{tab:translation-keys} \\ \toprule - \bfseries key & \bfseries fallback translation & \bfseries German \\ + \bfseries key & \bfseries language & \bfseries translation \\ \midrule - \showtranslations{scheme-name} \\ - \showtranslations{scheme-list} \\ - \showtranslations{Scheme} \\ - \showtranslations{scheme} \\ - \showtranslations{Schemes} \\ - \showtranslations{schemes} \\ - \showtranslations{K-acid} \\ - \showtranslations{K-base} \\ - \showtranslations{K-water} \\ - \showtranslations{phase-sld} \\ - \showtranslations{phase-lqd} \\ - \showtranslations{phase-gas} \\ - \showtranslations{phase-aq} \\ - \showtranslations{list-of-reactions} \\ - \showtranslations{Reaction} \\ - \showtranslations{reaction} \\ - \showtranslations{Reactions} \\ - \showtranslations{reactions} \\ + \endfirsthead + \toprule + \bfseries key & \bfseries language & \bfseries translation \\ + \midrule + \endhead \bottomrule - \end{tabular} -\end{table} - + \endlastfoot + \midrule + & & \hfill\emph{continues} \\ + \endfoot + \chemtranslationtable +\end{longtable} + \subsubsection{Information For Module Writers} +In addition to the commands from section~\vref{sec:avail-transl-keys} the +following macros are available: \begin{commands} \expandable\explcommand{chemmacros_translate:n}[ \marg{translation key}] Translates the given key to the language which is detected automatically @@ -2016,6 +2018,12 @@ translations for your language I'll gladly add them to the next release of \command{ChemTranslate}[\marg{translation key}] A version of \explcs{chemmacros_translate:n} for those who prefer traditional \LaTeXe\ programming over expl3. + \explcommand{chemmacros_declare_translation:nnn}[\marg{language}\marg{key}% + \marg{translation}] + The expl3 version of \cs{DeclareChemTranslation}. + \explcommand{chemmacros_declare_translations:nn}[\marg{key}\Marg{\meta{language} + = \meta{translation}}] + The expl3 version of \cs{DeclareChemTranslations}. \end{commands} \clearpage 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 28ffe5d485f..61a4a3fb93d 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 @@ -25,7 +25,7 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\ChemModule{acid-base}{2016/04/27 acid/base} +\ChemModule{acid-base}{2016/05/31 acid/base} \chemmacros_load_modules:n {charges} @@ -66,7 +66,9 @@ \tl_set:cn {l__chemmacros_#2_tl} { \chemmacros_translate:n {#2} } - \DeclareTranslationFallback {#2} {#3} + \chemmacros_if_compatiblity:nnTF {>} {5.6} + { \chemmacros_declare_translation:nnn {#2} {fallback} {#3} } + { \DeclareTranslationFallback {#2} {#3} } \cs_set_protected:Npn #1 { \ensuremath @@ -150,28 +152,13 @@ \ChemCompatibilityFrom{5.6} \chemmacros_declare_translations:nn {K-acid} { - fallback = \mathrm {a} , - English = \mathrm {a} , German = \mathrm {s} , Dutch = \mathrm {z} } - -\chemmacros_declare_translations:nn {K-base} - { - fallback = \mathrm {b} , - English = \mathrm {b} , - German = \mathrm {b} - } - -\chemmacros_declare_translations:nn {K-water} - { - fallback = \mathrm {w} , - English = \mathrm {w} , - German = \mathrm {w} - } \EndChemCompatibility % -------------------------------------------------------------------------- \tex_endinput:D 2016/02/04 - \NewChemEqConstant and family, new option `eq-constant' 2016/04/27 - moved translations from lang module to acid-base module +2016/05/31 - adapt to changes in `lang' module 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 04183909902..a1406a3b5cf 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}{2016/04/25 basic chemmacros module} +\ChemModule{base}{2016/05/04 basic chemmacros module} % for the document hooks \ChemCompatibilityFrom{5.1} 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 ae27236733c..21133f4caa2 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 @@ -25,7 +25,7 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\ChemModule{chemformula}{2016/04/27 integration of chemical formulas} +\ChemModule{chemformula}{2016/05/03 integration of chemical formulas} \RequirePackage{amstext} \chemmacros_load_module:n {charges} diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.errorcheck.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.errorcheck.code.tex index d6a89e4eb6d..3322c739339 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.errorcheck.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.errorcheck.code.tex @@ -25,7 +25,9 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\ChemModule{errorcheck}{2016/03/08 error checking for unloaded modules}[5.2] +\ChemModule{errorcheck}{2016/05/31 error checking for unloaded modules}[5.2] + +\RequirePackage{scrlfile} \msg_new:nnn {chemmacros} {undefined} { The~ #1~ `#2'~ is~ undefined.~ You~ need~ to~ load~ the~ `#3'~ module. } @@ -98,6 +100,15 @@ \chemmacros_command_requires_module:Nn \schemename {scheme} \chemmacros_command_requires_module:Nn \listofschemes {scheme} +\BeforePackage {chemscheme} + { + \cs_undefine:N \scheme + \cs_undefine:N \endscheme + \cs_undefine:N \listschemename + \cs_undefine:N \schemename + \cs_undefine:N \listofschemes + } + % spectroscopy module \chemmacros_command_requires_module:Nn \NMR {spectroscopy} \chemmacros_environment_requires_module:nn {experimental} {spectroscopy} @@ -117,4 +128,4 @@ 2015/10/14 - first version 2016/03/08 - add `polymers' module - +2016/05/31 - enable `chemscheme' to be loaded after chemmacros 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 8d0abe1695e..b6eb32d2383 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 @@ -25,7 +25,7 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\ChemModule{lang}{2016/04/27 language settings for chemmacros} +\ChemModule{lang}{2016/05/31 language settings for chemmacros} \RequirePackage{translations} @@ -43,16 +43,25 @@ % this token list will hold the chosen language for chemmacros; since the % language is either chosen automatically or by option it is only available at % begin document -\tl_new:N \l_chemmacros_language_tl -\tl_set:Nn \l_chemmacros_language_tl {english} -\tl_new:N \l__chemmacros_current_language_tl +\tl_new:N \l_chemmacros_language_tl +\tl_set:Nn \l_chemmacros_language_tl {english} +\tl_new:N \l__chemmacros_current_language_tl + +\tl_const:Nx \c__chemmacros_keyword_prefix_tl + { \chemmacros_if_compatiblity:nnT {>} {5.6} {chem-keyword-} } + +\prop_new:N \g_chemmacros_translations_prop % translate the key #1 \cs_new:Npn \chemmacros_translate:n #1 { \bool_if:NTF \l__chemmacros_language_auto_bool - { \GetTranslation {#1} } - { \GetTranslationFor {\l_chemmacros_language_tl} {#1} } + { \GetTranslation { \c__chemmacros_keyword_prefix_tl #1 } } + { + \GetTranslationFor + {\l_chemmacros_language_tl} + { \c__chemmacros_keyword_prefix_tl #1 } + } } \DeclareExpandableDocumentCommand \ChemTranslate {m} @@ -93,7 +102,7 @@ } % -------------------------------------------------------------------------- -\ChemCompatibilityFrom{5.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} } @@ -101,8 +110,8 @@ \use:x { \chemmacros_declare_translation:nnn - { \exp_not:V \l__chemmacros_tmpa_tl } { \exp_not:n {#1} } + { \exp_not:V \l__chemmacros_tmpa_tl } { \exp_not:V \l__chemmacros_tmpb_tl } } } @@ -111,7 +120,15 @@ % #2: lang % #3: translation \cs_new_protected:Npn \chemmacros_declare_translation:nnn #1#2#3 - { \DeclareTranslation {#1} {#2} {#3} } + { + % TODO: this should be \declaretranslation + \@trnslt@declare@translation + { \c__chemmacros_keyword_prefix_tl #1 } + {#2} + {#3} + \prop_gput:Nnn \g_chemmacros_translations_prop {#1(#2)} {#3} + } +\cs_generate_variant:Nn \chemmacros_declare_translation:nnn {V} % #1: key % #2: csv list: { = , = } @@ -128,6 +145,23 @@ \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 {} + +\cs_new_protected:Npn \__chemacros_parse_translate_list_entry:www #1(#2)\q_mark#3\q_stop + { \__chemmacros_parse_translate_list_entry:nnn {#1} {#2} {#3} } + +\cs_new_protected:Npn \chemmacros_for_all_translations_do:n #1 + { + \cs_set:Npn \__chemmacros_parse_translate_list_entry:nnn ##1##2##3 {#1} + \prop_map_inline:Nn \g_chemmacros_translations_prop + { \__chemacros_parse_translate_list_entry:www ##1 \q_mark ##2 \q_stop } + } + +\ChemCompatibilityFrom{5.7} +\NewDocumentCommand \ForAllChemTranslationsDo {+m} + { \chemmacros_for_all_translations_do:n {#1} } \EndChemCompatibility % -------------------------------------------------------------------------- @@ -141,3 +175,6 @@ - \DeclareChemTranslation and \DeclareChemTranslations - moved translations from lang module to the corresponding modules they belong to +2016/05/31 - add prefix string to translation keywords + - add logging of translation keywords + - \ForAllChemTranslationsDo 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 32fd36fdd52..5c409af08ca 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}{2015/09/23 chemical names} +\ChemModule{nomenclature}{2016/06/07 chemical names} \RequirePackage{scrlfile} @@ -205,19 +205,19 @@ \AfterEndPreamble { \chemmacros_make_iupac: } \EndChemCompatibility -\NewDocumentCommand \DeclareChemIUPAC { mm } - { \chemmacros_define_iupac:Nn #1 { #2 } } +\NewDocumentCommand \DeclareChemIUPAC {mm} + { \chemmacros_define_iupac:Nn #1 {#2} } -\NewDocumentCommand \NewChemIUPAC { mm } - { \chemmacros_new_iupac:Nn #1 { #2 } } +\NewDocumentCommand \NewChemIUPAC {mm} + { \chemmacros_new_iupac:Nn #1 {#2} } -\NewDocumentCommand \RenewChemIUPAC { mm } - { \chemmacros_renew_iupac:Nn #1 { #2 } } +\NewDocumentCommand \RenewChemIUPAC {mm} + { \chemmacros_renew_iupac:Nn #1 {#2} } -\NewDocumentCommand \ProvideChemIUPAC { mm } - { \chemmacros_provide_iupac:Nn #1 { #2 } } +\NewDocumentCommand \ProvideChemIUPAC {mm} + { \chemmacros_provide_iupac:Nn #1 {#2} } -\NewDocumentCommand \LetChemIUPAC { mm } +\NewDocumentCommand \LetChemIUPAC {mm} { \chemmacros_let_iupac:NN #1 #2 } \chemmacros_define_keys:nn {nomenclature} @@ -237,7 +237,7 @@ % stereo descriptors and other nomenclature commands % Cahn-Ingold-Prelog \dim_new:N \l__chemmacros_cip_kern_dim -\dim_set:Nn \l__chemmacros_cip_kern_dim { .075em } +\dim_set:Nn \l__chemmacros_cip_kern_dim {.075em} \chemmacros_define_keys:nn {nomenclature} { cip-kern .dim_set:N = \l__chemmacros_cip_kern_dim } @@ -246,8 +246,8 @@ \cs_new_protected:Npn \chemmacros_cip:n #1 { \textit{#1} \tex_kern:D \l__chemmacros_cip_kern_dim } -\NewDocumentCommand \cip { m } - { \chemmacros_cip:n { #1 } } +\NewDocumentCommand \cip {m} + { \chemmacros_cip:n {#1} } \EndChemCompatibility \ChemCompatibilityFrom{5.2} @@ -315,31 +315,49 @@ coord-use-hyphen .initial:n = true } -\cs_new_protected:Npn \chemformula_hapto:n #1 +% #1: boolean - if true hyphen is turned on +% #2: boolean - if true superscript will be used +% #3: symbol +% #4: sub-/superscript +\cs_new_protected:Npn \chemmacros_coordination_symbol:nnnn #1#2#3#4 { - \chemmacros_chemformula:n { \chemeta ^{#1} } - \bool_if:NT \l__chemmacros_coord_use_hyphen_bool + \chemmacros_chemformula:n {#3} + \tl_if_blank:nF {#4} + { + \bool_if:nTF {#2} + { \chemmacros_chemformula:n { {}^{#4} } } + { \chemmacros_chemformula:n { {}_{#4} } } + } + \bool_if:nT + {#1} { \chemmacros_break_point_hyphen: } } -\cs_new_protected:Npn \chemformula_dento:n #1 +\cs_new_protected:Npn \chemmacros_hapto:n #1 { - \chemmacros_chemformula:n { \chemkappa ^{#1} } - \bool_if:NT \l__chemmacros_coord_use_hyphen_bool - { \chemmacros_break_point_hyphen: } + \chemmacros_coordination_symbol:nnnn + { \l__chemmacros_coord_use_hyphen_bool } + { \c_false_bool } + { \chemeta } + {#1} } -\cs_new_protected:Npn \chemformula_bridge:n #1 +\cs_new_protected:Npn \chemmacros_dento:n #1 { - \chemmacros_chemformula:n {\chemmu} - \tl_if_blank:nF { #1 } - { - \bool_if:NTF \l__chemmacros_bridge_super_bool - { \chemmacros_chemformula:n { {}^{#1} } } - { \chemmacros_chemformula:n { {}_{#1} } } - } - \bool_if:NT \l__chemmacros_coord_use_hyphen_bool - { \chemmacros_break_point_hyphen: } + \chemmacros_coordination_symbol:nnnn + { \l__chemmacros_coord_use_hyphen_bool } + { \c_false_bool } + { \chemkappa } + {#1} + } + +\cs_new_protected:Npn \chemmacros_bridge:n #1 + { + \chemmacros_coordination_symbol:nnnn + { \l__chemmacros_coord_use_hyphen_bool } + { \l__chemmacros_bridge_super_bool } + { \chemmu } + {#1} } % \iupac (basically the same as bpchem's \IUPAC) @@ -557,13 +575,11 @@ \NewChemIUPACShorthand ' \chemprime \EndChemCompatibility -% \group_begin: -% \chemmacros_activate_all_iupac_shorthands: - -\cs_new_protected:Npn \chemmacros_iupac:n #1 +\cs_new_protected:Npn \chemmacros_iupac:nn #1#2 { \group_begin: \bool_set_true:N \l__chemmacros_inside_iupac_bool + \chemmacros_set_keys:nn {nomenclature} {#1} \chemmacros_make_iupac: \chemmacros_make_shorthands: % what's this vvv in here for? @@ -572,11 +588,12 @@ { \chemmacros_define_deprecated:NN \- - } \tl_set_rescan:Nnn \l__chemmacros_tmpa_tl { \chemmacros_activate_all_iupac_shorthands: } - {#1} + {#2} \l__chemmacros_tmpa_tl \group_end: } -% \group_end: + +\cs_new_protected:Npn \chemmacros_iupac:n #1 { \chemmacros_iupac:nn {} {#1} } \ChemCompatibilityTo{5.2} % Thanks to Joseph Wright and Enrico Gregorio for the help on the curious @@ -586,7 +603,7 @@ \cs_set_eq:NN \@dischyph \- \EndChemCompatibility -\NewDocumentCommand \iupac {m} { \chemmacros_iupac:n {#1} } +\NewDocumentCommand \iupac {O{}m} { \chemmacros_iupac:nn {#1} {#2} } % -------------------------------------------------------------------------- % R(ectus)/S(inister): @@ -635,9 +652,9 @@ \NewChemIUPAC \anti { \textit {anti} } % coordination chemistry: -\NewChemIUPAC \hapto { \chemformula_hapto:n } -\NewChemIUPAC \dento { \chemformula_dento:n } -\NewChemIUPAC \bridge { \chemformula_bridge:n } +\NewChemIUPAC \hapto { \chemmacros_hapto:n } +\NewChemIUPAC \dento { \chemmacros_dento:n } +\NewChemIUPAC \bridge { \chemmacros_bridge:n } % attachments to heteroatoms / added hydrogen \NewChemIUPAC \hydrogen { \textit {H} } @@ -665,28 +682,28 @@ % -------------------------------------------------------------------------- % latin phrases -\tl_new:N \l__chemmacros_latin_format_tl -\tl_set:Nn \l__chemmacros_latin_format_tl { \itshape } +\tl_new:N \l__chemmacros_latin_format_tl + +\NewChemMacroset {Latin} {mm} + { \chemmacros_define_latin:Nn #1 {#2} } +\ChemCompatibilityTo{5.6} \chemmacros_define_keys:nn {nomenclature} { latin-format .tl_set:N = \l__chemmacros_latin_format_tl , - latin-format .initial:n = \textit + latin-format .initial:n = \textit , } \cs_new_protected:Npn \chemmacros_latin:n #1 { { \l__chemmacros_latin_format_tl {#1} } } - + \cs_new_protected:Npn \chemmacros_define_latin:Nn #1#2 { \cs_set_protected:Npn #1 { \chemmacros_latin:n {#2} } } - -\NewChemMacroset {Latin} {mm} - { \chemmacros_define_latin:Nn #1 {#2} } - + \AtBeginDocument { % if chemstyle is loaded use chemstyle's definition: - \chemmacros_if_package_loaded:nTF {chemstyle} + \chemmacros_if_package_loaded:nT {chemstyle} { \AfterPackage* {chemstyle} { @@ -694,16 +711,57 @@ \cs_set_eq:NN \chemmacros_latin:n \cst@latin } } + \cs_if_exist:NTF \latin + { \cs_set_eq:NN \latin \chemmacros_latin:n } { \cs_new_eq:NN \latin \chemmacros_latin:n } \NewChemLatin \insitu {in~situ} \NewChemLatin \abinitio {ab~initio} \NewChemLatin \invacuo {in~vacuo} } +\EndChemCompatibility + +\ChemCompatibilityFrom{5.7} +\chemmacros_define_keys:nn {nomenclature} + { + format .tl_set:N = \l__chemmacros_latin_format_tl , + format .initial:n = \emph , + } + +\cs_new_protected:Npn \chemmacros_write_latin:n #1 + { + \group_begin: + \l__chemmacros_latin_format_tl {#1} + \group_end: + } + +\cs_new_protected:Npn \chemmacros_latin:n #1 + { \chemmacros_write_latin:n {#1} } + +\cs_new_protected:Npn \chemmacros_define_latin:Nn #1#2 + { \DeclareDocumentCommand #1 {O{}} { \latin [##1] {#2} } } + +\NewDocumentCommand \latin {O{}m} + { + \group_begin: + \chemmacros_set_keys:nn {nomenclature} {#1} + \chemmacros_latin:n {#2} + \group_end: + } + +\AtBeginDocument + { + \AfterPackage* {chemstyle} { \cs_undefine:N \invacuo } + \NewChemLatin \insitu {in~situ} + \NewChemLatin \abinitio {ab~initio} + \NewChemLatin \invacuo {in~vacuo} + } + +\EndChemCompatibility % -------------------------------------------------------------------------- % hyperref support % ?? unsure about adding IUPAC commands -\AfterPackage* { hyperref } +\AfterPackage* {hyperref} { \pdfstringdefDisableCommands { @@ -757,3 +815,13 @@ 2016/01/02 - \chemprime 2016/01/23 - give shorthand definitions only inside \iupac 2016/01/25 - small improvements (?) of the shorthand code +2016/05/08 - check if \latin is already defined (eg by achemso) and overwrite + definition +2016/05/10 - define \chemmacros_hapto:n and friends in terms of + \chemmacros_coordination_symbol:nnnn + - \iupac gets an optional argument for setting options +2016/05/31 - overwrite any \latin definition -- or rather: just define \latin + - \latin and all macros defined with \NewChemLatin get an optional + argument for setting options +2016/06/07 - rename functions which erroneously were assigned to the + `chemformula' module diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.orbital.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.orbital.code.tex index f30b71e10b1..2a3c751e426 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.orbital.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.orbital.code.tex @@ -573,3 +573,4 @@ { \chemmacros_orbital:n {#1} } \group_end: } +% -------------------------------------------------------------------------- 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 38fa658a8f5..2ab75a98e14 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 @@ -25,7 +25,7 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\ChemModule{phases}{2015/06/09 phase descriptors} +\ChemModule{phases}{2016/05/31 phase descriptors} \chemmacros_load_module:n {chemformula} @@ -44,6 +44,7 @@ \NewChemMacroset {Phase} {mm} { \chemmacros_define_phase:Nn #1 {#2} } +\ChemCompatibilityTo{5.6} \cs_new_protected:Npn \chemmacros_define_phase:Nn #1#2 { \tl_set:Nx \l__chemmacros_tmpa_tl { phase-\chemmacros_remove_backslash:N #1 } @@ -54,6 +55,20 @@ \__chemmacros_define_phase:Nx #1 { \exp_not:N \chemmacros_translate:n { \exp_not:V \l__chemmacros_tmpa_tl } } } +\EndChemCompatibility + +\ChemCompatibilityFrom{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 } + \chemmacros_declare_translation:Vnn + \l__chemmacros_tmpa_tl + {fallback} + {#2} + \__chemmacros_define_phase:Nx #1 + { \exp_not:N \chemmacros_translate:n { \exp_not:V \l__chemmacros_tmpa_tl } } + } +\EndChemCompatibility \cs_new_protected:Npn \__chemmacros_define_phase:Nn #1#2 { @@ -101,30 +116,20 @@ \chemmacros_declare_translations:nn {phase-sld} { fallback = s , - English = s , German = f } \chemmacros_declare_translations:nn {phase-lqd} { fallback = l , - English = l , German = f\/l } \chemmacros_declare_translations:nn {phase-gas} - { - fallback = g , - English = g , - German = g - } + { fallback = g } \chemmacros_declare_translations:nn {phase-aq} - { - fallback = aq , - English = aq , - German = aq - } + { fallback = aq } \EndChemCompatibility % -------------------------------------------------------------------------- @@ -132,3 +137,4 @@ 2015/06/09 - first version 2016/04/27 - moved translations from lang module to phases module +2016/05/31 - adapt to changes in `lang' module diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.polymers.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.polymers.code.tex index dc304d4ba55..6b03453ff25 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.polymers.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.polymers.code.tex @@ -25,7 +25,7 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\ChemModule{polymers}{2016/03/07 polymers} +\ChemModule{polymers}{2016/03/08 polymers} \chemmacros_load_modules:n {nomenclature,tikz} 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 652a300af86..b325a046787 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 @@ -25,7 +25,7 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\ChemModule{reactions}{2016/04/27 reaction environments} +\ChemModule{reactions}{2016/05/04 reaction environments} \chemmacros_load_module:n {chemformula} @@ -353,14 +353,14 @@ \DeclareTranslation {English} {list-of-reactions} {List~ of~ Reactions} \DeclareTranslation {German} {list-of-reactions} {Reaktionsverzeichnis} \DeclareTranslation {Italian} {list-of-reactions} {Elenco~ delle~ reazioni} -\DeclareTranslation {French} {list-of-reactions} {Table~ des~ r\'eactions} +\DeclareTranslation {French} {list-of-reactions} {Table~ des~ r\'{e}actions} \DeclareTranslation {Dutch} {list-of-reactions} {Lijst~ van~ reacties} \DeclareTranslationFallback {reaction} {Reaction} \DeclareTranslation {English} {reaction} {Reaction} \DeclareTranslation {German} {reaction} {Reaktion} \DeclareTranslation {Italian} {reaction} {Reazione} -\DeclareTranslation {French} {reaction} {R\'eaction} +\DeclareTranslation {French} {reaction} {R\'{e}action} \DeclareTranslation {Dutch} {reaction} {Reactie} \EndChemCompatibility @@ -371,7 +371,7 @@ English = List~ of~ Reactions , German = Reaktionsverzeichnis , Italian = Elenco~ delle~ reazioni , - French = Table~ des~ r\'eactions , + French = Table~ des~ r\'{e}actions , Dutch = Lijst~ van~ reacties } 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 ba4a9959b7a..2efabd57922 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 @@ -25,7 +25,7 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\ChemModule{redox}{2015/09/11 oxidation numbers, redox reactions} +\ChemModule{redox}{2015/09/30 oxidation numbers, redox reactions} \chemmacros_load_modules:n {tikz,xfrac} 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 3545b0663a4..c0700c7091c 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 @@ -181,7 +181,7 @@ \cs_new_protected:Npn \chemmacros_define_float:nn #1#2 { \bool_if:nT - { !\cs_if_exist_p:c {#1} && !\cs_if_exist_p:c {#1} } + { !\cs_if_exist_p:c {#1} && !\cs_if_exist_p:c {end#1} } { \bool_if:NTF \l__chemmacros_float_def_bool { 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 c0a91dea8b0..2c543a8e494 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 @@ -25,7 +25,7 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\ChemModule{spectroscopy}{2015/06/09 environment for spectroscopic data} +\ChemModule{spectroscopy}{2015/12/31 environment for spectroscopic data} \chemmacros_load_modules:n {chemformula} \RequirePackage{siunitx} diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.tikz.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.tikz.code.tex index 8d70a4ac0ba..934c069d9f3 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.tikz.code.tex +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.tikz.code.tex @@ -25,7 +25,7 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\ChemModule*{tikz}{2015/07/24 upright greek symbols} +\ChemModule*{tikz}{2015/10/26 upright greek symbols} \RequirePackage{tikz} \usetikzlibrary{calc,decorations.pathmorphing} diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty index c39f55d0614..4e85031c2c2 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty @@ -31,9 +31,9 @@ % -------------------------------------------------------------------------- % package information: -\tl_const:Nn \c_chemmacros_date_tl {2016/05/04} +\tl_const:Nn \c_chemmacros_date_tl {2016/06/08} \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_minor_number_tl {7} \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} @@ -518,4 +518,18 @@ Version history (reactions) - add cleveref and fancyref support (reactions) - add cleveref and fancyref support (scheme) + - \DeclareChemTranslation and + \DeclareChemTranslations + - moved translations from lang module to the + corresponding modules they belong to 2016/05/04 - version 5.6a - fix small but annoying bugs (base and chemformula) +2016/06/07 - version 5.7 - \iupac gets an optional argument for setting + options (nomenclature) + - \latin always defined by chemmacros (nomenclature) + - fix conflict with `achemso' (nomenclature) + - allow `chemscheme'/`chemstyle' to be loaded after + chemmacros (errorcheck) + - translation keys get internal prefix (translations) +2016/06/08 - version 5.7a - rename functions which erroneously were assigned + to the `chemformula' module + - correct wrong dates in module files -- cgit v1.2.3