Skip to content

Commit

Permalink
resolve issue #31
Browse files Browse the repository at this point in the history
  • Loading branch information
cgnieder committed Mar 7, 2020
1 parent 019a932 commit 1c83051
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 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.11 2020/02/29
the CHEMMACROS package v5.11 2020/03/07

comprehensive support for typesetting chemistry documents

Expand Down
5 changes: 2 additions & 3 deletions chemmacros.history
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ Version history
- prefer lazy boolean evaluation
- prefer the kernel commands to
\chemmacros_leave_vmode: and \chemmacros_tex_if:
2020/02/29 - version 5.11 - use \ch even for simple formulas – resolves issue
#28 (chemformula)
- let \chemmacros_iupac:nn think we're in the
2020/03/07 - version 5.11 - let \chemmacros_iupac:nn think we're in the
document – fixes issue #30 (nomenclature)
- add option redox/format
8 changes: 3 additions & 5 deletions chemmacros.module.chemformula.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,7 @@
{
\chemmacros_integrate_package:nnn {} {chemformula} {2015/09/08}
\cs_set_protected:Npn \chemmacros_chemformula:n #1
{
\chemmacros_if_compatibility:nnTF {>} {5.10}
{ \chemformula_ch:nn {} {#1} }
{ \chemformula_chcpd:nn {} {#1} }
}
{ \chemformula_chcpd:nn {} {#1} }
\cs_set_protected:Npn \chemmacros_reaction:n #1
{ \chemformula_ch:nn {} {#1} }
}
Expand Down Expand Up @@ -243,3 +239,5 @@
2016/05/03 - correct wrong method check
2020/02/02 - lazy boolean evaluation
2020/02/29 - use \ch even for simple formulas – resolves issue #28
2020/03/02 - undo last change: this makes problems with oxidation numbers in a
reaction
27 changes: 25 additions & 2 deletions chemmacros.module.redox.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,20 @@
\bool_new:N \l__chemmacros_ox_top_bool
\bool_new:N \l__chemmacros_ox_align_center_bool

\ChemCompatibilityFrom{5.11}
\tl_new:N \l__chemmacros_ox_format_tl
\EndChemCompatibility

\int_new:N \l__chemmacros_ox_number_int
\fp_new:N \l__chemmacros_ox_number_fp

\cs_new_protected:Npn \__chemmacros_ox_format:n #1
{
\chemmacros_if_compatibility:nnTF {>=} {5.11}
{ { \l__chemmacros_ox_format_tl {#1} } }
{ \use:n {#1} }
}

\cs_new_protected:Npn \__chemmacros_ox_process_number:n #1
{
\bool_if:NTF \l__chemmacros_ox_parse_bool
Expand Down Expand Up @@ -180,7 +191,10 @@
\hbox_set:Nn \l__chemmacros_tmpa_box
{
\chemmacros_text:n
{ \relsize {-3} \__chemmacros_ox_process_number:n {#1} }
{
\__chemmacros_ox_format:n
{ \relsize {-3} \__chemmacros_ox_process_number:n {#1} }
}
}
\hbox_set:Nn \l__chemmacros_tmpb_box { \chemmacros_chemformula:n {#2} }
\chemmacros_math:n
Expand All @@ -196,7 +210,10 @@
{
\box_use:N \l__chemmacros_tmpb_box
\tl_use:N \l__chemmacros_ox_side_connect_tl
( \__chemmacros_ox_process_number:n {#1} )
(
\__chemmacros_ox_format:n
{ \__chemmacros_ox_process_number:n {#1} }
)
}
}
\bool_if:NT \l__chemmacros_ox_top_bool
Expand Down Expand Up @@ -285,6 +302,11 @@
}
\EndChemCompatibility

\ChemCompatibilityFrom{5.11}
\chemmacros_define_keys:nn {redox}
{ format .tl_set:N = \l__chemmacros_ox_format_tl }
\EndChemCompatibility

% \ox[<keyval>]{<num>,<atom>}
% \ox*[<keyval>]{<num>,<atom>} => always number on the top
\cs_new_protected:Npn \chemmacros_ox:nnnn #1#2#3#4
Expand Down Expand Up @@ -433,3 +455,4 @@
2015/09/30 - new option `explicit-zero-sign'
2020/02/02 - lazy boolean evaluation
- prefer \legacy_if:nTF over \chemmacros_if_tex:nnTF
2020/03/02 - add option redox/format
2 changes: 1 addition & 1 deletion chemmacros.sty
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

% --------------------------------------------------------------------------
% package information:
\tl_const:Nn \c_chemmacros_date_tl {2020/02/29}
\tl_const:Nn \c_chemmacros_date_tl {2020/03/07}
\tl_const:Nn \c_chemmacros_version_major_number_tl {5}
\tl_const:Nn \c_chemmacros_version_minor_number_tl {11}
\tl_const:Nn \c_chemmacros_version_subrelease_tl {}
Expand Down

0 comments on commit 1c83051

Please sign in to comment.