From c3543d4162f0c935de31c1c1198d9f6e04992485 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 29 Jun 2013 00:20:35 +0000 Subject: chemnum (5jun13) git-svn-id: svn://tug.org/texlive/trunk@31025 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/chemnum/chemnum.sty | 263 +++++++++++------------- 1 file changed, 115 insertions(+), 148 deletions(-) (limited to 'Master/texmf-dist/tex/latex/chemnum') diff --git a/Master/texmf-dist/tex/latex/chemnum/chemnum.sty b/Master/texmf-dist/tex/latex/chemnum/chemnum.sty index 28e40a1dc3e..af6e6c07c8f 100644 --- a/Master/texmf-dist/tex/latex/chemnum/chemnum.sty +++ b/Master/texmf-dist/tex/latex/chemnum/chemnum.sty @@ -32,46 +32,25 @@ \ProvidesExplPackage {chemnum} - {2013/04/17} - {0.6a} + {2013/06/05} + {0.6b} {a comprehensive approach for the numbering of chemical compounds} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% CHECK FOR SUPPORT -% this part of the code is based on the corresponding part of siunitx.sty -% l3 support: -\cs_if_exist:NTF \msg_set:nnnn - { - \msg_set:nnnn { chemnum } { support-outdated } - { Support~package~#1~too~old. } - { - Please~install~an~up~to~date~version~of~#1. \\ - Best~would~be~to~update~both~l3kernel~and~l3packages~bundles. \\ - Loading~chemnum~will~abort! - } - } +% -------------------------------------------------------------------------- +% check expl3 version: +\@ifpackagelater { expl3 } { 2012/11/21 } + { } { - \PackageError { chemnum } { Support~bundle~l3kernel~too~old. } + \PackageError { chemnum } { Support~package~expl3~too~old } { - Please~install~an~up~to~date~version~of~the~l3kernel~bundle. \\ + You~need~to~update~your~installation~of~the~bundles~'l3kernel'~and~ + 'l3packages'.\MessageBreak Loading~chemnum~will~abort! } \tex_endinput:D } -\@ifpackagelater { expl3 } { 2011/12/27 } - { } - { - \msg_error:nnx { chemnum } { support-outdated } { expl3 } - \tex_endinput:D - } - -\@ifpackagelater { xparse } { 2011/12/27 } - { } - { - \msg_error:nnx { chemnum } { support-outdated } { xparse } - \tex_endinput:D - } +% -------------------------------------------------------------------------- % error for missing packages \msg_set:nnnn { chemnum } { support-missing } { Support~package~#1~missing. } @@ -100,7 +79,7 @@ { \AtEndPreamble { - \exp_args:No \file_if_exist:nTF { textgreek . sty } + \file_if_exist:nTF { textgreek . sty } { \@ifpackageloaded { textgreek } { \msg_warning:nnx { chemnum } { textgreek-loaded } { #1 } } @@ -245,15 +224,17 @@ \int_new:N \g__chemnum_cmpd_main_int \prop_new:N \g__chemnum_label_prop \int_new:N \g__chemnum_cmpd_int +\int_new:N \l__chemnum_tmpa_int \tl_new:N \l__chemnum_tmpa_tl \tl_new:N \l__chemnum_tmpb_tl -\clist_new:N \g__chemnum_cmpd_save_clist +\tl_new:N \l__chemnum_tmpc_tl +\seq_new:N \g__chemnum_cmpd_saved_seq %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % READ FROM PREVIOUS RUN, SAVE FOR NEXT RUN % save all labels in a clist -\cs_new_protected:Npn \__chemnum_cmpd_save:n #1 - { \clist_gput_right:Nn \g__chemnum_cmpd_save_clist { { #1 } } } +\cs_new_protected:Npn \chemnum_cmpd_save:n #1 + { \seq_gput_right:Nn \g__chemnum_cmpd_saved_seq { #1 } } \msg_set:nnn { chemnum } { missing-cmpd-file } { @@ -271,7 +252,7 @@ { \iow_new:N \__chemnum_aux_file: \iow_open:Nn \__chemnum_aux_file: { ./ \c_job_name_tl . cmpd } - \clist_map_inline:Nn \g__chemnum_cmpd_save_clist + \seq_map_inline:Nn \g__chemnum_cmpd_saved_seq { \iow_now:Nx \__chemnum_aux_file: { @@ -305,29 +286,11 @@ \bool_new:N \l__chemnum_cmpd_style_is_macro_bool % default style -\cs_new:Npn \__chemnum_cmpd_style_value:n { } +\cs_new:Npn \chemnum_cmpd_style:n #1 { #1 } -% error message -\msg_set:nnn { chemnum } { cmpd-style } - { - The~value~of~"cmpd-style~=~