diff options
author | Karl Berry <karl@freefriends.org> | 2012-02-20 23:31:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-02-20 23:31:10 +0000 |
commit | 96948f06651bb4a4bb0174bb28d9d6d443ada4e4 (patch) | |
tree | bc564db764d728bbd08c5726e606e82e95acb5f8 /Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty | |
parent | 1c39817dbba19c5ef1e95912dabb3805085871ac (diff) |
chemmacros (20feb12)
git-svn-id: svn://tug.org/texlive/trunk@25448 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty | 404 |
1 files changed, 287 insertions, 117 deletions
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty index fcba2944cd4..01888f2ff44 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/02/10 - % +% - 2012/02/19 - % % --------------------------------------------------------------------------- % % - https://bitbucket.org/cgnieder/chemmacros/ - % % - contact@mychemistry.eu - % @@ -27,10 +27,15 @@ % - - % % - The Current Maintainer of this work is Clemens Niederberger. - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\RequirePackage{ expl3 , xparse , l3keys2e , xfrac , siunitx , tikz , mathtools , environ , scrlfile , etoolbox , bm } +\RequirePackage{ expl3 , xparse , l3keys2e , xfrac , siunitx } +\RequirePackage{ tikz , mathtools , environ , scrlfile , etoolbox , bm } \usetikzlibrary{calc,arrows} -\ProvidesExplPackage {chemmacros} {2012/02/10} {3.0d} {macros and commands for chemists} +\ProvidesExplPackage + {chemmacros} + {2012/02/19} + {3.1} + {macros and commands for chemists} \@ifpackageloaded { chemformula } {} { \RequirePackage { chemformula } } @@ -54,9 +59,13 @@ \bool_new:N \l_chemmacros_chemfig_bool \bool_new:N \l_chemmacros_ghsystem_bool \bool_set_true:N \l_chemmacros_ghsystem_bool +\bool_new:N \l_chemmacros_iupac_restricted_bool +\bool_new:N \l_chemmacros_iupac_strict_bool +\bool_new:N \l_chemmacros_in_document_bool \AtBeginDocument { + \bool_set_true:N \l_chemmacros_in_document_bool \@ifpackageloaded { chemstyle } { \bool_set_true:N \l_chemmacros_chemstyle_bool } { \bool_set_false:N \l_chemmacros_chemstyle_bool } @@ -84,6 +93,7 @@ % method => use `chemformula' or `mhchem' % strict => errors or warnings % synchronize => let particles et.al. adapt chemformula's font selection +% iupac => behaviour of nomenclature commands % version=1 => compatibility for documents set with v1.* \bool_new:N \l_chemmacros_strict_bool @@ -101,7 +111,6 @@ { \bool_set_false:N \l_chemmacros_circled_chem_bool } , circletype / chem .code:n = { \bool_set_true:N \l_chemmacros_circled_chem_bool } , - circletype .default:n = chem , circled .choice: , circled / none .code:n = { @@ -118,33 +127,27 @@ \bool_set_true:N \l_chemmacros_circled_bool \bool_set_false:N \l_chemmacros_circled_formal_bool } , - circled .default:n = formal , + circled .default:n = all , detect-bold .bool_set:N = \l_chemmacros_detect_bold_bool , detect-bold .default:n = true , - EZ .choice: , - EZ / cool .code:n = - { \bool_set_true:N \l_chemmacros_EZ_cool_bool } , - EZ / chemmacros .code:n = - { \bool_set_false:N \l_chemmacros_EZ_cool_bool } , - EZ .default:n = chemmacros , + EZ .code:n = + \chemmacros_msg:nnxx { chemmacros } { option-deprecated } { EZ } {} , german .bool_set:N = \l_chemmacros_german_bool , german .default:n = true , ghsystem .bool_set:N = \l_chemmacros_ghsystem_bool , ghsystem .default:n = true , - ngerman .bool_set:N = \l_chemmacros_german_bool , - ngerman .default:n = true , method .choice: , method / chemformula .code:n = \bool_set_false:N \l_chemmacros_use_mhchem_bool , method / mhchem .code:n = \bool_set_true:N \l_chemmacros_use_mhchem_bool , - method .default:n = chemformula , + ngerman .bool_set:N = \l_chemmacros_german_bool , + ngerman .default:n = true , Nu .choice: , Nu / mathspec .code:n = \bool_set_true:N \l_chemmacros_Nu_mathspec_bool , Nu / chemmacros .code:n = \bool_set_false:N \l_chemmacros_Nu_mathspec_bool , - Nu .default:n = chemmacros , strict .bool_set:N = \l_chemmacros_strict_bool , strict .default:n = true , synchronize .choice: , @@ -152,6 +155,16 @@ \cs_set_eq:NN \chemmacros_inner_font: \chemformula_font_inner: , synchronize / false .code:n = \cs_set:Nn \chemmacros_inner_font: {} , synchronize .default:n = true , + iupac .choice: , + iupac / restricted .code:n = + \bool_set_true:N \l_chemmacros_iupac_restricted_bool + \bool_set_false:N \l_chemmacros_iupac_strict_bool , + iupac / auto .code:n = + \bool_set_false:N \l_chemmacros_iupac_restricted_bool + \bool_set_false:N \l_chemmacros_iupac_strict_bool , + iupac / strict .code:n = + \bool_set_false:N \l_chemmacros_iupac_restricted_bool + \bool_set_true:N \l_chemmacros_iupac_strict_bool , xspace .bool_set:N = \l_chemmacros_xspace_bool , xspace .default:n = true , version .choice: , @@ -203,20 +216,29 @@ See~the~documentation~for~more~information. } +\msg_set:nnn { chemmacros } { option-deprecated } + { The~option~#1~is~deprecated.~I~will~ignore~it. } + +\msg_set:nnn { chemmacros } { command-deprecated } + { + The~command~\token_to_str:N #1 \c_space_tl is~deprecated.~Use~ + \token_to_str:N #2 \c_space_tl instead. + } + \msg_set:nnnn { chemmacros } { declare-particle } { The~command~sequence~ \token_to_str:N #1 \c_space_tl is~already~defined. } { - You've~tried~to~define~a~particle~with~\token_to_str:N \DeclareChemParticle ,~but - ~the~command~sequence~ \token_to_str:N #1 \c_space_tl already~exists.~Choose~ - another~name. + You've~tried~to~define~a~particle~with~\token_to_str:N \DeclareChemParticle, + ~but~the~command~sequence~ \token_to_str:N #1 \c_space_tl already~exists. + ~Choose~another~name. } \msg_set:nnnn { chemmacros } { renew-particle } { The~particle~ \token_to_str:N #1 \c_space_tl is~not~defined. } { - You've~tried~to~renew~the~particle~\token_to_str:N #1 , but~it~doesn't~ + You've~tried~to~renew~the~particle~\token_to_str:N #1 ,~but~it~doesn't~ exist. } @@ -225,18 +247,35 @@ The~command~sequence~ \token_to_str:N #1 \c_space_tl is~already~defined. } { - You've~tried~to~define~a~particle~with~\token_to_str:N \DeclareChemPhase ,~but - ~the~command~sequence~ \token_to_str:N #1 \c_space_tl already~exists.~Choose~ - another~name. + You've~tried~to~define~a~particle~with~\token_to_str:N \DeclareChemPhase , + ~but~the~command~sequence~ \token_to_str:N #1 \c_space_tl already~exists. + ~Choose~another~name. } \msg_set:nnnn { chemmacros } { renew-phase } { The~phase~ \token_to_str:N #1 \c_space_tl is~not~defined. } { - You've~tried~to~renew~the~phase~\token_to_str:N #1 , but~it~doesn't~ + You've~tried~to~renew~the~phase~\token_to_str:N #1 ,~but~it~doesn't~ exist. } +\msg_set:nnnn { chemmacros } { declare-iupac } + { + The~iupac~naming~command~ \token_to_str:N #1 \c_space_tl is~already~defined. + } + { + You've~tried~to~define~a~iupac~naming~command~with~\token_to_str:N + \DeclareChemIUPAC,~but~the~iupac~command~ \token_to_str:N #1 \c_space_tl + already~exists.~Choose~another~name~or~use~\token_to_str:N \RenewChemIUPAC . + } + +\msg_set:nnnn { chemmacros } { renew-iupac } + { The~iupac~naming~command~ \token_to_str:N #1 \c_space_tl is~not~defined. } + { + You've~tried~to~renew~the~iupac~command~\token_to_str:N #1 ,~but~it~doesn't~ + exist.~Use~\token_to_str:N \DeclareChemIUPAC \c_space_tl instead . + } + \msg_set:nnn { chemmacros } { ox } { \token_to_str:N \ox \c_space_tl : ~ #1 ~ \msg_line_context: . @@ -259,18 +298,18 @@ work~properly~\msg_line_context: . } -\msg_set:nnn { chemmacros } { setnewstate } +\msg_set:nnn { chemmacros } { DeclareChemState } { The~state~ \exp_after:wN \token_to_str:N \cs:w #1 \cs_end: \c_space_tl already~exists.~You~need~to~use~ - \token_to_str:N \renewstate \c_space_tl to~alter~it. + \token_to_str:N \RenewChemState \c_space_tl to~alter~it. } -\msg_set:nnn { chemmacros } { renewstate } +\msg_set:nnn { chemmacros } { RenewChemState } { The~state~\exp_after:wN \token_to_str:N \cs:w #1 \cs_end: \c_space_tl isn't~set~up~yet.~You~need~to~use~ - \token_to_str:N \setnewstate \c_space_tl to~create~it. + \token_to_str:N \DeclareChemState \c_space_tl to~create~it. } % --------------------------------------------------------------------------- % @@ -382,22 +421,29 @@ % --------------------------------------------------------------------------- % % transition state symbol +\cs_new_nopar:Npn \chemmacros_transition_state_aux: + { + \text + { + \skip_horizontal:n { .1ex } + \hbox_overlap_right:n + { \rule { .6ex } { 0pt } \rule { .05ex } { 1.3ex } } + \hbox_overlap_right:n { \rule [ .4ex ] { 1.3ex } { .05ex } } + \rule [ .85ex ] { 1.3ex } { .05ex } + \skip_horizontal:n { .1ex } + } + } + \cs_new_nopar:Npn \transitionstatesymbol - { \ensuremath { \chemmacros_transitionstatesymbol: } } -\cs_new_nopar:Npn \chemmacros_transitionstatesymbol: - { \mathpalette \chemmacros_transitionstatesymbol_aux: = } -\cs_new_nopar:Npn \chemmacros_transitionstatesymbol_aux: #1#2 { - \ooalign + \ensuremath { - \tex_hfil:D - $#1\mid$ - \tex_hfil:D - \tex_cr:D - \tex_hfil:D - $#1#2$ - \tex_hfil:D - \tex_cr:D + \mathchoice + { \displaystyle } + { \textstyle } + { \scriptstyle } + { \scriptscriptstyle } + \chemmacros_transition_state_aux: } } @@ -412,7 +458,8 @@ \cs_new:Nn \chemmacros_text:n { \mode_if_math:TF { \text { #1 } } { #1 } } -% add a possibility to let chemformula use the chemformula with method=chemformula, too +% add a possibility to let chemformula use the chemformula +% with method=chemformula, too \tl_new:N \l_chemmacros_chemformula_tl \cs_new:Nn \chemmacros_chemformula:n { @@ -611,8 +658,10 @@ \bool_if:NTF \l_chemmacros_use_mhchem_bool { \cs_new_nopar:Npn \Hpl { \chemmacros_atom:n { H } \pch \chemmacros_xspace: } - \cs_new_nopar:Npn \Hyd { \chemmacros_atom:n { OH } \mch \chemmacros_xspace: } - \cs_new_nopar:Npn \HtO { \chemmacros_chemformula:n { H3O } \pch \chemmacros_xspace: } + \cs_new_nopar:Npn \Hyd + { \chemmacros_atom:n { OH } \mch \chemmacros_xspace: } + \cs_new_nopar:Npn \HtO + { \chemmacros_chemformula:n { H3O } \pch \chemmacros_xspace: } \cs_new_nopar:Npn \El { \chemmacros_atom:n { E } \pch \chemmacros_xspace: } } { @@ -662,7 +711,9 @@ \bool_if:NTF \l_chemmacros_chemfig_bool { \bool_if:NTF \l_chemmacros_elpair_dots_bool - { { \chemmacros_inner_font: #1 \Lewis { 0: , { \vphantom { #1 } } } } } + { + { \chemmacros_inner_font: #1 \Lewis { 0: , { \vphantom { #1 } } } } + } { { \chemmacros_inner_font: #1 \Lewis { 0 , \vphantom { #1 } } } } } { @@ -692,16 +743,83 @@ elpair .default:n = dots } -% --------------------------------------------------------------------------- % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% IUPAC +\prop_new:N \l_chemmacros_iupac_prop + +\NewDocumentCommand \DeclareChemIUPAC { mm } + { + \tl_set_rescan:Nnn \l_tmpa_tl { \char_set_catcode_letter:N \\ } { #1 } + \tl_set:Nf \l_tmpa_tl { \tl_tail:V \l_tmpa_tl } + \prop_if_in:NoTF \l_chemmacros_iupac_prop { \l_tmpa_tl } + { \chemmacros_msg:nnxx { chemmacros } { declare-iupac } { #1 } { } } + { \prop_put:Non \l_chemmacros_iupac_prop { \l_tmpa_tl } { #2 } } + \chemmacros_make_iupac: + } + +\NewDocumentCommand \RenewChemIUPAC { mm } + { + \tl_set_rescan:Nnn \l_tmpa_tl { \char_set_catcode_letter:N \\ } { #1 } + \tl_set:Nf \l_tmpa_tl { \tl_tail:V \l_tmpa_tl } + \prop_if_in:NoTF \l_chemmacros_iupac_prop { \l_tmpa_tl } + { \prop_put:Non \l_chemmacros_iupac_prop { \l_tmpa_tl } { #2 } } + { \chemmacros_msg:nnxx { chemmacros } { renew-iupac } { #1 } { } } + \chemmacros_make_iupac: + } + +\cs_new_nopar:Npn \chemmacros_make_iupac: + { + \bool_if:NT \l_chemmacros_in_document_bool + { + \bool_if:NTF \l_chemmacros_inside_iupac_bool + { + \prop_map_inline:Nn \l_chemmacros_iupac_prop + { \cs_set_protected_nopar:cpn { ##1 } { ##2 } } + } + { + \bool_if:NF \l_chemmacros_iupac_restricted_bool + { + \bool_if:NTF \l_chemmacros_iupac_strict_bool + { + \prop_map_inline:Nn \l_chemmacros_iupac_prop + { \cs_set_protected_nopar:cpn { ##1 } { ##2 } } + } + { + \prop_map_inline:Nn \l_chemmacros_iupac_prop + { + \cs_if_exist:cF { ##1 } + { \cs_set_protected_nopar:cpn { ##1 } { ##2 } } + } + } + } + } + } + } + +\AtBeginDocument { \chemmacros_make_iupac: } + % stereo descriptors and other nomenclature commands % Cahn-Ingold-Prelog -\cs_new_protected_nopar:Npn \Rcip { \textit { (R) } } -\cs_new_protected_nopar:Npn \Scip { \textit { (S) } } -\cs_new_protected_nopar:Npn \cip #1 { \textit { (#1) } } +\NewDocumentCommand \cip { m } { \textit { (#1) } } + +\cs_new_protected_nopar:Npn \Rcip + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \Rcip } { \R } + \cip { R } + } +\cs_new_protected_nopar:Npn \Scip + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \Scip } { \S } + \cip { S } + } +\DeclareChemIUPAC \R { \cip { R } } +\DeclareChemIUPAC \S { \cip { S } } % TikZ needs : to be other \ExplSyntaxOff -\NewDocumentCommand\Sconf { O { S } }% +\NewDocumentCommand\Sconf{O{S}} {% \tikz[baseline=(a.base),text height=1.5ex,text depth=.25ex] { @@ -710,61 +828,55 @@ }% } -\NewDocumentCommand \Rconf { O { R } }% +\NewDocumentCommand\Rconf{O{R}} {% \tikz[baseline=(a.base),text height=1.5ex,text depth=.25ex] { \node(a) {#1} ; \draw[<-,thick,rotate=90] ($(a.center)+(20:.8em)$) arc (20:340:.8em) ; }% - }% + } \ExplSyntaxOn % E(ntgegen)/Z(usammen) -\AtBeginDocument - { - \bool_if:NTF \l_chemmacros_EZ_cool_bool - { - \cs_new_protected_nopar:Npn \Ent { \textit { (E) } } - \cs_new_protected_nopar:Npn \Zus { \textit { (Z) } } - } - { - \cs_if_free:NTF \E - { \cs_new_protected_nopar:Npn \E { \textit { (E) } } } - { \cs_set_protected_nopar:Npn \E { \textit { (E) } } } - \cs_new_protected_nopar:Npn \Z { \textit { (Z) } } - } - } +\DeclareChemIUPAC \E { \textit { (E) } } +\DeclareChemIUPAC \Z { \textit { (Z) } } % cis/trans & tert -\AtBeginDocument - { - \cs_if_free:NTF \cis - { \cs_new_protected_nopar:Npn \cis { \textit { cis } } } - { \cs_set_protected_nopar:Npn \cis { \textit { cis } } } - \cs_if_free:NTF \trans - { \cs_new_protected_nopar:Npn \trans { \textit { trans } } } - { \cs_set_protected_nopar:Npn \trans { \textit { trans } } } - } -\cs_new_protected_nopar:Npn \tert { \textit { tert } } +\DeclareChemIUPAC \cis { \textit{ cis } } +\DeclareChemIUPAC \trans { \textit { trans } } +\DeclareChemIUPAC \tert { \textit { tert } } % Fischer -\cs_new_protected_nopar:Npn \Dfi { \textsc { d } } -\cs_new_protected_nopar:Npn \Lfi { \textsc { l } } +\cs_set_protected_nopar:Npn \Dfi + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \Dfi } { \D } + \textsc { d } + } +\cs_set_protected_nopar:Npn \Lfi + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \Lfi } { \L } + \textsc { l } + } +\DeclareChemIUPAC \D { \textsc { d } } +\DeclareChemIUPAC \L { \textsc { l } } % ortho/meta/para -\cs_new_protected_nopar:Npn \ortho { \textsl { o } } -\cs_new_protected_nopar:Npn \meta { \textsl { m } } -\cs_new_protected_nopar:Npn \para { \textsl { p } } +\DeclareChemIUPAC \ortho { \textsl { o } } +\DeclareChemIUPAC \meta { \textsl { m } } +\DeclareChemIUPAC \para { \textsl { p } } % syn/anti -\cs_new_protected_nopar:Npn \syn { \textit { syn } } -\cs_new_protected_nopar:Npn \anti { \textit { anti } } +\DeclareChemIUPAC \syn { \textit { syn } } +\DeclareChemIUPAC \anti { \textit { anti } } % \iupac (basically the same as bpchem's \IUPAC) % - allows multiple breaking points as compound names can get really long and % especially in multicolumn documents can span more than two lines % - add a (very) little space after the hyphen +% - enables all naming commands regardless if they're definied otherwise or not \cs_new_protected:Nn \chemmacros_allow_hyphens: { \tex_penalty:D \c_ten_thousand \skip_horizontal:n { \c_zero_dim } } \cs_new_protected:Nn \chemmacros_break_point_hyphen: @@ -776,9 +888,13 @@ \chemmacros_allow_hyphens: } +\bool_new:N \l_chemmacros_inside_iupac_bool + \cs_new_protected:Nn \chemmacros_iupac:n { \group_begin: + \bool_set_true:N \l_chemmacros_inside_iupac_bool + \chemmacros_make_iupac: \tex_ignorespaces:D \cs_set_eq:NN \- \chemmacros_break_point_hyphen: \cs_set_eq:NN \| \chemmacros_break_point: @@ -793,7 +909,7 @@ \cs_set_protected_nopar:Npx \- { \exp_not:o { \- } } \cs_set_eq:NN \@dischyph \- -\cs_set_eq:NN \iupac \chemmacros_iupac:n +\cs_set_eq:NN \iupac \chemmacros_iupac:n % latin phrases \AtBeginDocument @@ -812,9 +928,15 @@ % --------------------------------------------------------------------------- % % acid/base \cs_new_nopar:Npn \pH - { \mbox { \chemmacros_detect_bold:n { \textsl { p } H } } \chemmacros_xspace: } + { + \mbox { \chemmacros_detect_bold:n { \textsl { p } H } } + \chemmacros_xspace: + } \cs_new_nopar:Npn \pOH - { \mbox { \chemmacros_detect_bold:n { \textsl { p } OH } } \chemmacros_xspace: } + { + \mbox { \chemmacros_detect_bold:n { \textsl { p } OH } } + \chemmacros_xspace: + } \NewDocumentCommand \p { m } { \mbox @@ -924,10 +1046,10 @@ % --------------------------------------------------------------------------- % % substituents -% \R[<sign>]{<subscript>} +% \Rad[<sign>]{<subscript>} \char_set_catcode_math_subscript:N \@ -\NewDocumentCommand \R { o g } +\NewDocumentCommand \Rad { o g } { \chemmacros_atom:n { @@ -1354,11 +1476,17 @@ \tikz[remember~picture,overlay] { \chemmacros_tikz_draw:f { \tl_use:N \l_chemmacros_redox_tikz_tl } - ($(\l_chemmacros_redox_begin_tl . \l_chemmacros_redox_side_tl)+(0,\l_chemmacros_redox_sep_dim)$) + ($ + (\l_chemmacros_redox_begin_tl . + \l_chemmacros_redox_side_tl)+(0,\l_chemmacros_redox_sep_dim) + $) -- ++(0,\l_chemmacros_redox_shift_tl * \l_chemmacros_redox_dist_dim) -| node [pos=.25,\l_chemmacros_redox_anchor_tl] { { #4 } } - ($(\l_chemmacros_redox_end_tl . \l_chemmacros_redox_side_tl)+(0,\l_chemmacros_redox_sep_dim)$) ; + ($ + (\l_chemmacros_redox_end_tl . + \l_chemmacros_redox_side_tl)+(0,\l_chemmacros_redox_sep_dim) + $) ; } } @@ -1766,10 +1894,10 @@ \tl_set:Nn \l_chemmacros_reaction_lorname_tl { #1 ~ } } -% \newreaction[<keyval>]{<name>}{<type>} +% \DeclareChemReaction[<keyval>]{<name>}{<type>} \bool_if:NF \l_chemmacros_version_one_bool { - \NewDocumentCommand \newreaction { o m m } + \NewDocumentCommand \DeclareChemReaction { o m m } { \cs_if_exist:cTF { #2 } { \msg_error:nnx { chemmacros } { already-defined } { #2 } } @@ -1834,6 +1962,12 @@ } \ignorespaces } + \cs_set:Npn \newreaction + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \newreaction } { \DeclareChemReaction } + \DeclareChemReaction + } } \cs_new:Npn \chemmacros_equation_chemformula:n #1 @@ -1847,8 +1981,8 @@ % predefined: \bool_if:NF \l_chemmacros_version_one_bool { - \newreaction [ star ] { reaction } { equation } - \newreaction [ star ] { reactions } { align } + \DeclareChemReaction [ star ] { reaction } { equation } + \DeclareChemReaction [ star ] { reactions } { align } } % --------------------------------------------------------------------------- % @@ -1998,10 +2132,10 @@ \l_chemmacros_thermod_delta_default_tl } -% \setnewstate[<keyval>]{<name>}{<symbol>}{<unit>} +% \DeclareChemState[<keyval>]{<name>}{<symbol>}{<unit>} \bool_if:NF \l_chemmacros_version_one_bool { - \cs_new:Npn \setnewstate + \cs_new:Npn \DeclareChemState { \bool_set_false:N \l_chemmacros_renewstate_bool \chemmacros_setnewstate_reset: @@ -2009,8 +2143,8 @@ { \setnewstate_aux_i:n } { \setnewstate_aux_ii:nnn } } -% \renewstate[<keyval>]{<name>}{<symbol>}{<unit>} - \cs_new:Npn \renewstate +% \RenewChemState[<keyval>]{<name>}{<symbol>}{<unit>} + \cs_new:Npn \RenewChemState { \bool_set_true:N \l_chemmacros_renewstate_bool \chemmacros_setnewstate_reset: @@ -2018,6 +2152,18 @@ { \setnewstate_aux_i:n } { \setnewstate_aux_ii:nnn } } + \cs_set:Npn \setnewstate + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \setnewstate } { \DeclareChemState } + \DeclareChemState + } + \cs_set:Npn \renewstate + { + \chemmacros_msg:nnxx { chemmacros } { command-deprecated } + { \renewstate } { \RenewChemState } + \RenewChemState + } } \cs_new_nopar:Npn \chemmacros_setnewstate_reset: @@ -2152,10 +2298,10 @@ % predefined: \bool_if:NF \l_chemmacros_version_one_bool { - \setnewstate {Enthalpy} {H} {\kilo\joule\per\mole} - \setnewstate [ delta=false, subscript-left=false ] {Entropy} + \DeclareChemState {Enthalpy} {H} {\kilo\joule\per\mole} + \DeclareChemState [ delta=false, subscript-left=false ] {Entropy} {S} {\joule\per\kelvin\per\mole} - \setnewstate {Gibbs} {G} {\kilo\joule\per\mole} + \DeclareChemState {Gibbs} {G} {\kilo\joule\per\mole} } % --------------------------------------------------------------------------- % @@ -2453,9 +2599,10 @@ \keys_define:nn { chemmacros / orbital / s } { phase .choice: , - phase / + .code:n = { \bool_set_true:N \l_chemmacros_orbital_s_phase_bool } , - phase / - .code:n = { \bool_set_false:N \l_chemmacros_orbital_s_phase_bool } , - phase .default:n = + , + phase / + .code:n = + { \bool_set_true:N \l_chemmacros_orbital_s_phase_bool } , + phase / - .code:n = + { \bool_set_false:N \l_chemmacros_orbital_s_phase_bool } , scale .tl_set:N = \l_chemmacros_orbital_s_scale_tl , color .tl_set:N = \l_chemmacros_orbital_s_color_tl } @@ -2501,8 +2648,10 @@ \keys_define:nn { chemmacros / orbital / p } { phase .choice: , - phase / + .code:n = { \bool_set_true:N \l_chemmacros_orbital_p_phase_bool } , - phase / - .code:n = { \bool_set_false:N \l_chemmacros_orbital_p_phase_bool } , + phase / + .code:n = + { \bool_set_true:N \l_chemmacros_orbital_p_phase_bool } , + phase / - .code:n = + { \bool_set_false:N \l_chemmacros_orbital_p_phase_bool } , scale .tl_set:N = \l_chemmacros_orbital_p_scale_tl , angle .fp_set:N = \l_chemmacros_orbital_angle_fp , color .tl_set:N = \l_chemmacros_orbital_p_color_tl , @@ -2595,8 +2744,10 @@ \keys_define:nn { chemmacros / orbital / sp } { phase .choice: , - phase / + .code:n = { \bool_set_true:N \l_chemmacros_orbital_sp_phase_bool } , - phase / - .code:n = { \bool_set_false:N \l_chemmacros_orbital_sp_phase_bool } , + phase / + .code:n = + { \bool_set_true:N \l_chemmacros_orbital_sp_phase_bool } , + phase / - .code:n = + { \bool_set_false:N \l_chemmacros_orbital_sp_phase_bool } , scale .tl_set:N = \l_chemmacros_orbital_sp_scale_tl , angle .fp_set:N = \l_chemmacros_orbital_angle_fp , color .tl_set:N = \l_chemmacros_orbital_sp_color_tl @@ -2684,8 +2835,10 @@ \keys_define:nn { chemmacros / orbital / sp2 } { phase .choice: , - phase / + .code:n = { \bool_set_true:N \l_chemmacros_orbital_sptwo_phase_bool } , - phase / - .code:n = { \bool_set_false:N \l_chemmacros_orbital_sptwo_phase_bool } , + phase / + .code:n = + { \bool_set_true:N \l_chemmacros_orbital_sptwo_phase_bool } , + phase / - .code:n = + { \bool_set_false:N \l_chemmacros_orbital_sptwo_phase_bool } , scale .tl_set:N = \l_chemmacros_orbital_sptwo_scale_tl , angle .fp_set:N = \l_chemmacros_orbital_angle_fp , color .tl_set:N = \l_chemmacros_orbital_sptwo_color_tl @@ -2773,8 +2926,10 @@ \keys_define:nn { chemmacros / orbital / sp3 } { phase .choice: , - phase / + .code:n = { \bool_set_true:N \l_chemmacros_orbital_spthree_phase_bool } , - phase / - .code:n = { \bool_set_false:N \l_chemmacros_orbital_spthree_phase_bool } , + phase / + .code:n = + { \bool_set_true:N \l_chemmacros_orbital_spthree_phase_bool } , + phase / - .code:n = + { \bool_set_false:N \l_chemmacros_orbital_spthree_phase_bool } , scale .tl_set:N = \l_chemmacros_orbital_spthree_scale_tl , angle .fp_set:N = \l_chemmacros_orbital_angle_fp , color .tl_set:N = \l_chemmacros_orbital_spthree_color_tl @@ -3046,10 +3201,11 @@ Version history - new commands \p, \fplus, \fminus, \fpch, \fmch, \fscrp, \fsrcm, \fdelp, \fdelm, \orbital, \chemsetup - various commands have a new syntax - - removed: \setmhName, \setredoxdist, \setstatesubscript, - \porb, \phorb, \pxorb, \pyorb, \pzorb, \setorbheight, - \solid, \liquid - - reaction environments work with hyperref and varioref + - removed: \setmhName, \setredoxdist, + \setstatesubscript, \porb, \phorb, \pxorb, \pyorb, + \pzorb, \setorbheight, \solid, \liquid + - reaction environments work with hyperref and + varioref 2011/11/03 - version 2.0a - minor bug fixes - new feature for \Nu - new command \ba @@ -3070,7 +3226,8 @@ Version history - renamed formula => chemformula and ghs => ghsystem to make the names unique (following a request by Karl Berry for TeXlive) -2012/02/03 - version 3.0b - new command \DeclareChemParticle, updated documentation +2012/02/03 - version 3.0b - new command \DeclareChemParticle, updated + documentation 2012/02/05 - version 3.0c - renamed pictogram files (following a request by Karl Berry for TeXlive) - new package option "Nu" @@ -3078,9 +3235,22 @@ Version history - bugfixes with \DeclareChemParticle - new command \RenewChemParticle - new option phases / pos - - new commands \DeclareChemPhase, \RenewChemPhase, \phase + - new commands \DeclareChemPhase, \RenewChemPhase, + \phase - changed default behaviour of phases - removed optional argument from \sld and \lqd +2012/02/19 - version 3.1 - new commands \DeclareChemIUPAC and \RenewChemIUPAC + - new option iupac + - deprecated option: EZ + - deprecated commands: + \newreaction => \DeclareChemReaction + \setnewstate => \DeclareChemState + \renewstate => \RenewChemState + \Rcip => \R + \Scip => \S + \Dfi => \D + \Lfi => \L + - new arrow types in the chemformula package % --------------------------------------------------------------------------- % % TODO: |