Skip to content

Commit

Permalink
version 5.8a
Browse files Browse the repository at this point in the history
  • Loading branch information
cgnieder committed Jun 13, 2017
1 parent d5c7fd0 commit 808589f
Show file tree
Hide file tree
Showing 16 changed files with 219 additions and 135 deletions.
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -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

Expand Down
9 changes: 9 additions & 0 deletions chemmacros.history
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions chemmacros.module.acid-base.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}}
Expand Down
2 changes: 1 addition & 1 deletion chemmacros.module.chemformula.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
\EndChemCompatibility

% --------------------------------------------------------------------------
\ChemCompatibilityTo{5.0}
\ChemCompatibilityTo{5.1}
\chemmacros_set_formula_method:n {chemformula}
\EndChemCompatibility

Expand Down
6 changes: 2 additions & 4 deletions chemmacros.module.lang.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -80,7 +80,7 @@
language .initial:n = auto
}

\ChemCompatibilityTo{5.2}
\ChemCompatibilityTo{5.3}
\chemmacros_define_global_keys:n
{
german .meta:n = { language = german } ,
Expand All @@ -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} }
Expand Down Expand Up @@ -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 {}

Expand Down
65 changes: 38 additions & 27 deletions chemmacros.module.nomenclature.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -242,15 +242,15 @@
\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 }

\NewDocumentCommand \cip {m}
{ \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
Expand Down Expand Up @@ -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:
Expand All @@ -443,35 +443,53 @@
}
\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:
}
}
\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 }
\dim_new:N \l__chemmacros_iupac_hyphen_post_dim
\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
Expand All @@ -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}
Expand All @@ -509,6 +515,7 @@
\tex_kern:D \l__chemmacros_iupac_hyphen_post_dim
}
}
\EndChemCompatibility

\cs_new_protected:Npn \chemmacros_break_point:
{
Expand All @@ -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 { - } { ( } { ( } }
Expand Down Expand Up @@ -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} }
}
}
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ,
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion chemmacros.module.particles.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
\NewChemNucleophile \Nuc {Nu}
\NewChemNucleophile \ba {ba}

\ChemCompatibilityTo{5.2}
\ChemCompatibilityTo{5.3}
\DeclareChemDeprecated \Hto \Oxo
\DeclareChemDeprecated \Nu \Nuc
\EndChemCompatibility
Expand Down
4 changes: 2 additions & 2 deletions chemmacros.module.phases.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -98,7 +98,7 @@
\NewChemPhase \aq {aq}

% --------------------------------------------------------------------------
\ChemCompatibilityTo{5.5}
\ChemCompatibilityTo{5.6}
\DeclareTranslation {English} {phase-sld} {s}
\DeclareTranslation {German} {phase-sld} {f}

Expand Down
12 changes: 6 additions & 6 deletions chemmacros.module.reactions.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -204,7 +204,7 @@
\EndChemCompatibility

% create new tagform
\ChemCompatibilityTo{5.5}
\ChemCompatibilityTo{5.6}
\newtagform {reaction} {\{} {\}}
\EndChemCompatibility
\ChemCompatibilityFrom{5.6}
Expand All @@ -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':
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion chemmacros.module.redox.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
\group_end:
}

\ChemCompatibilityTo{5.3}
\ChemCompatibilityTo{5.4}
\cs_new_protected:Npn \__chemmacros_ox_sign:n #1
{
\bool_if:nT
Expand Down
2 changes: 1 addition & 1 deletion chemmacros.module.scheme.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
}

% --------------------------------------------------------------------------
\ChemCompatibilityTo{5.5}
\ChemCompatibilityTo{5.6}
\DeclareTranslationFallback {scheme-name} {Scheme}
\DeclareTranslation {English} {scheme-name} {Scheme}
\DeclareTranslation {German} {scheme-name} {Schema}
Expand Down
18 changes: 11 additions & 7 deletions chemmacros.module.spectroscopy.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 { ~ = } }
}

Expand Down Expand Up @@ -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
}
}
}
{
Expand Down
Loading

0 comments on commit 808589f

Please sign in to comment.