diff options
author | Karl Berry <karl@freefriends.org> | 2012-03-14 23:25:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-03-14 23:25:20 +0000 |
commit | 244839b0edef369eaae2ca5624a8deac38db65d1 (patch) | |
tree | c1e747e65882bcb1d8509ec1582368838fb26f15 /Master/texmf-dist/tex/latex/chemmacros | |
parent | ed4534197eb59eaaf55a6254c40708e64bfc6890 (diff) |
chemmacros (14mar12)
git-svn-id: svn://tug.org/texlive/trunk@25645 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemmacros')
4 files changed, 89 insertions, 37 deletions
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty b/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty index a5555476e0d..11b5e014f7f 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty +++ b/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty @@ -5,7 +5,7 @@ % - macros and commands for chemists - % % --------------------------------------------------------------------------- % % - Clemens Niederberger - % -% - 2012/03/03 - % +% - 2012/03/14 - % % --------------------------------------------------------------------------- % % - https://bitbucket.org/cgnieder/chemmacros/ - % % - contact@mychemistry.eu - % @@ -30,8 +30,8 @@ \RequirePackage{ expl3 } \ProvidesExplPackage {chemformula} - {2012/03/03} - {3.1b} + {2012/03/14} + {3.1c} {typeset chemical compounds and reactions} %-----------------------------------------------------------------------------% @@ -251,9 +251,9 @@ % determine length in dependency of labels \cs_new:Npn \chemformula_determine_arrow_length:nn #1#2 { - \hbox_set:Nn \l_tmpa_box { { #1 } } + \box_set_eq:NN \l_tmpa_box #1 \dim_set:Nn \l_tmpa_dim { \box_wd:N \l_tmpa_box } - \hbox_set:Nn \l_tmpa_box { { #2 } } + \box_set_eq:NN \l_tmpa_box #2 \dim_set:Nn \l_tmpb_dim { \box_wd:N \l_tmpa_box } \box_clear:N \l_tmpa_box \dim_compare:nTF { \l_tmpa_dim >= \l_tmpb_dim } @@ -290,8 +290,8 @@ \prop_new:N \l_chemformula_arrows_code_prop \seq_new:N \l_chemformula_arrows_type_seq \tl_new:N \l_chemformula_arrow_type_tl -\tl_new:N \l_chemformula_arrow_arg_i_tl -\tl_new:N \l_chemformula_arrow_arg_ii_tl +\box_new:N \l_chemformula_arrow_arg_i_box +\box_new:N \l_chemformula_arrow_arg_ii_box % read optional arguments \cs_new_nopar:Npn \l_chemformula_arrow_read_args:w @@ -303,7 +303,8 @@ \cs_new_nopar:Npn \l_chemformula_arrow_read_args_aux_i:w [#1] { - \tl_set:Nn \l_chemformula_arrow_arg_i_tl { #1 } + \hbox_set:Nn \l_chemformula_arrow_arg_i_box + { \tl_use:N \l_chemformula_arrow_label_style_tl #1 } \peek_meaning:NTF [ { \l_chemformula_arrow_read_args_aux_ii:w } { \l_chemformula_arrow_read_args_aux_iii: } @@ -311,7 +312,8 @@ \cs_new_nopar:Npn \l_chemformula_arrow_read_args_aux_ii:w [#1] { - \tl_set:Nn \l_chemformula_arrow_arg_ii_tl { #1 } + \hbox_set:Nn \l_chemformula_arrow_arg_ii_box + { \tl_use:N \l_chemformula_arrow_label_style_tl #1 } \l_chemformula_arrow_read_args_aux_iii: } @@ -329,8 +331,8 @@ \cs_new_nopar:Npn \chemformula_arrows_get:n #1 { % first clear the arguments - \tl_clear:N \l_chemformula_arrow_arg_i_tl - \tl_clear:N \l_chemformula_arrow_arg_ii_tl + \box_clear:N \l_chemformula_arrow_arg_i_box + \box_clear:N \l_chemformula_arrow_arg_ii_box % then get the arrow type \tl_set:Nn \l_chemformula_arrow_type_tl { #1 } \l_chemformula_arrow_read_args:w @@ -343,9 +345,9 @@ % TODO: flexible Pfeilspitzen, TikZ-Keys ermöglichen \tl_set_rescan:Nnn \l_tmpc_tl { \char_set_catcode_letter:N \_ } { #1 } % determine length of the arrow - \chemformula_determine_arrow_length:oo - { \l_chemformula_arrow_arg_i_tl } - { \l_chemformula_arrow_arg_ii_tl } + \chemformula_determine_arrow_length:NN + \l_chemformula_arrow_arg_i_box + \l_chemformula_arrow_arg_ii_box \chemformula_tikz:nf { inner~sep=0, baseline=(chemformula_arrow_start.base) } { @@ -370,23 +372,17 @@ % the arrow labels: \draw node - [ - above=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] at (cf_arrow_mid) { \l_chemformula_arrow_arg_i_tl } + [ above=\l_chemformula_arrow_label_offset_dim ] at (cf_arrow_mid) + { \box_use:N \l_chemformula_arrow_arg_i_box } node - [ - below=\l_chemformula_arrow_label_offset_dim, - font=\l_chemformula_arrow_label_style_tl, - butt~cap-butt~cap - ] at (cf_arrow_mid) { \l_chemformula_arrow_arg_ii_tl } + [ below=\l_chemformula_arrow_label_offset_dim ] at (cf_arrow_mid) + { \box_use:N \l_chemformula_arrow_arg_ii_box } ; \tl_use:N \l_tmpc_tl } } \cs_generate_variant:Nn \chemformula_arrow_draw:n { V } -\cs_generate_variant:Nn \chemformula_determine_arrow_length:nn { oo } +\cs_generate_variant:Nn \chemformula_determine_arrow_length:nn { NN } % commands to declare arrows (can also be used by users): % #1: symbol, #2: code @@ -1696,6 +1692,8 @@ VERSION HISTORY various flaws: clear distinction between isotope and formula - new option charge-vshift +2012/03/14 - version 3.1c - a few changes in chemmacros.sty + - improved arrow labels %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % TODO diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty index c12b04033ca..77dab7f9d0c 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty @@ -5,7 +5,7 @@ % - macros and commands for chemists - % % --------------------------------------------------------------------------- % % - Clemens Niederberger - % -% - 2012/03/03 - % +% - 2012/03/14 - % % --------------------------------------------------------------------------- % % - https://bitbucket.org/cgnieder/chemmacros/ - % % - contact@mychemistry.eu - % @@ -33,8 +33,8 @@ \ProvidesExplPackage {chemmacros} - {2012/03/03} - {3.1b} + {2012/03/14} + {3.1c} {macros and commands for chemists} \@ifpackageloaded { chemformula } {} { \RequirePackage { chemformula } } @@ -181,12 +181,16 @@ \bool_set_false:N \l_chemmacros_use_upgreek_bool \bool_set_false:N \l_chemmacros_use_textgreek_bool , upgreek .default:n = upgreek , - version .choice: , - version / 1 .code:n = + % dummy version for compatibility with KOMA's global option and backwards + % compatibility of chemmacros + version .code:n = , + % TODO: neuen Namen finden! + cmversion .choice: , + cmversion / 1 .code:n = { \bool_set_true:N \l_chemmacros_version_one_bool } , - version / 2 .code:n = + cmversion / 2 .code:n = { \bool_set_false:N \l_chemmacros_version_one_bool } , - version / bundle .code:n = + cmversion / bundle .code:n = { \bool_set_false:N \l_chemmacros_version_one_bool } , xspace .bool_set:N = \l_chemmacros_xspace_bool , xspace .default:n = true @@ -1833,7 +1837,7 @@ { \addcontentsline { lor } { reaction } { - \l_chemmacros_reaction_lorname_tl #3 ##1 #4 + \l_chemmacros_reaction_lorname_tl #3 #2 ##1 #4 \tl_use:c { l_chemmacros_reaction_ \thereaction _tl } } } @@ -1881,6 +1885,7 @@ \bool_if:NTF \l_chemmacros_version_one_bool { \usetagform { CMreaction } } { \usetagform { reaction } } + % => this is problematic because it disallows resetting the counter: \tl_new:c { l_chemmacros_reaction_ \thereaction _tl } } @@ -3257,6 +3262,9 @@ Version history - deprecated option: "option/detect-bold" 2012/03/03 - version 3.1b - changes in the chemformula package - IUPAC compliance for \Delta and \ox +2012/03/14 - version 3.1c - compatibility with KOMA's global option + "version = <value>" + - bugfix in the list of reactions % --------------------------------------------------------------------------- % % TODO: diff --git a/Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty b/Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty index 43a250ef30a..72e2ab854e7 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty +++ b/Master/texmf-dist/tex/latex/chemmacros/ghsystem.sty @@ -5,7 +5,7 @@ % - macros and commands for chemists - % % --------------------------------------------------------------------------- % % - Clemens Niederberger - % -% - 2012/03/03 - % +% - 2012/03/14 - % % --------------------------------------------------------------------------- % % - https://bitbucket.org/cgnieder/chemmacros/ - % % - contact@mychemistry.eu - % @@ -30,8 +30,8 @@ \RequirePackage{ expl3 } \ProvidesExplPackage {ghsystem} - {2012/03/03} - {3.1b} + {2012/03/14} + {3.1c} {globally harmonised system} % --------------------------------------------------------------------------- % @@ -454,6 +454,7 @@ VERSION HISTORY package 2012/02/26 - version 3.1a - changes in the chemmacros package 2012/03/03 - version 3.1b - changes in packages chemformula and chemmacros +2012/03/14 - version 3.1c - changes in packages chemformula and chemmacros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % TODO: diff --git a/Master/texmf-dist/tex/latex/chemmacros/language/ghsystem_langtemplate.def b/Master/texmf-dist/tex/latex/chemmacros/language/ghsystem_langtemplate.def index d0e308f4a70..cd39ca89831 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/language/ghsystem_langtemplate.def +++ b/Master/texmf-dist/tex/latex/chemmacros/language/ghsystem_langtemplate.def @@ -5,7 +5,7 @@ % - macros and commands for chemists - % % --------------------------------------------------------------------------- % % - Clemens Niederberger - % -% - 2012/01/30 - % +% - 2012/03/03 - % % --------------------------------------------------------------------------- % % - http://www.mychemistry.eu/ - % % - contact@mychemistry.eu - % @@ -27,6 +27,51 @@ % - - % % - The Current Maintainer of this work is Clemens Niederberger. - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% A few informations how to use this template: +% +% The H, EUH, and P statements are stored in a property list, respectively. +% The commands for adding a respective entry are pre-typed so you only have to +% fill in the missing text. +% The commands are in a logical order (first H then EUH then P, numbers +% increasing) and have hints where to find the corresponding statements in the +% EU regulation 1272/2008. +% You will notice that some of the gaps are pre-filled with commands like +% `\ghsystem_exposure:'. These commands are called “fill-in functions” and put a +% corresponding replacement text in their position depending on package options +% used. They should _not_ be replaced but be in the corresponding position in +% statement where the replacement text should appear. +% +% You need to know: +% - every gap that is to be filled is indicated be three dots: ... +% - you need to take care of hyphenation by adding \- at the appropriate places +% - you need to take care of special symbols such as ä replaced with \"a etc. +% so the statements can be used with latex, pdflatex, xelatex, and lualatex as +% well +% - for the fill-in functions the original English text is given to help you +% identify the right one +% +% You may find it helpful to have a look at existing language files. You'll find +% them in the directory of chemmacros in your TeX installation in a +% sub-directory called `language'. +% +% To test your language file you have to name it +% \ghsystem_<language name>.def +% for example by replacing `langtemplate' in the name of this file. Then place a +% copy in the `language' directory of chemmacros. You now can use it with +% \chemsetup[ghsystem]{language=<language name>} +% I suggest running a test file similar to this: +% ----------------------------------------------------------------------------- +% \documentclass{article} +% \usepackage{chemmacros} +% \chemsetup[ghsystem]{language=<language name>,fill-in=true} +% \begin{document} +% +% \ghslistall +% +% \end{document} +% ----------------------------------------------------------------------------- +% \ExplSyntaxOn % <LANGUAGE> DEFINITIONS \prop_clear:N \l_ghsystem_h_prop |