diff options
author | Karl Berry <karl@freefriends.org> | 2015-10-21 21:08:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-10-21 21:08:04 +0000 |
commit | ca8b37e0e9b1a89ad33804cfb8404f919c01b1f0 (patch) | |
tree | 918f841962543928f9839874400073051be3a82b /Master/texmf-dist/tex/latex/substances/substances-default.def | |
parent | 906cc538429df04e26a1f8bbf54ff6930e1ffb1b (diff) |
substances (21oct15)
git-svn-id: svn://tug.org/texlive/trunk@38684 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/substances/substances-default.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/substances/substances-default.def | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/Master/texmf-dist/tex/latex/substances/substances-default.def b/Master/texmf-dist/tex/latex/substances/substances-default.def index f802dbc00c5..c88c6a98fc3 100644 --- a/Master/texmf-dist/tex/latex/substances/substances-default.def +++ b/Master/texmf-dist/tex/latex/substances/substances-default.def @@ -8,7 +8,7 @@ % Web: https://bitbucket.org/cgnieder/substances/ % E-Mail: contact@mychemistry.eu % -------------------------------------------------------------------------- -% Copyright 2012 Clemens Niederberger +% Copyright 2012--2015 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -30,51 +30,50 @@ % feel free to contact me. % -------------------------------------------------------------------------- % substances: default style -\RequirePackage { chemfig , siunitx } +\SubstancesStyle*{default} +\RequirePackage {chemfig,siunitx} % ---------------------------------------------------------------------------- % helper functions for the GHS properties: -\cs_new:Npn \substances_get_pics:n #1 +\cs_new_protected:Npn \substances_get_pics:n #1 { - \int_zero:N \l_tmpa_int - \clist_map_inline:nn { #1 } - { - \int_incr:N \l_tmpa_int - \int_compare:nF { \l_tmpa_int = 1 } { ~ } - \ghspic{##1} - } + \seq_set_split:Nnn \l_tmpa_seq {,} {#1} + \seq_set_map:NNn \l_tmpa_seq \l_tmpa_seq { \ghspic {##1} } + \seq_use:Nn \l_tmpa_seq {~} } -\cs_new:Npn \substances_get_ghs:nn #1#2 +\cs_new_protected:Npn \substances_get_ghs:nn #1#2 { - \int_zero:N \l_tmpa_int - \clist_map_inline:nn { #2 } - { - \int_incr:N \l_tmpa_int - \int_compare:nF { \l_tmpa_int = 1 } - { \bool_if:NT \l_ghsystem_hide_statement_bool { , } ~ } - \ghs{#1}{##1} - } + \seq_set_split:Nnn \l_tmpa_seq {,} {#2} + \seq_set_map:NNn \l_tmpa_seq \l_tmpa_seq { \ghs {#1} {##1} } + \seq_use:Nn \l_tmpa_seq + { \bool_if:NT \l__ghsystem_hide_statement_bool {,} ~ } } +\NewDocumentCommand \ghspictograms {m} + { \substances_get_pics:n {#1} } + +\NewDocumentCommand \ghsstatements {mm} + { \substances_get_ghs:nn {#1} {#2} } + % ---------------------------------------------------------------------------- -\DeclareSubstanceProperty { formula } [\ch] -\DeclareSubstanceProperty { structure } [\chemfig] -\DeclareSubstanceProperty { mass } [\SI][{\MolMass}] -\DeclareSubstanceProperty { bp } [\SI][{\celsius}] -\DeclareSubstanceProperty { mp } [\SI][{\celsius}] -\DeclareSubstanceProperty { density } [\SI][{\gram\per\cmc}] -\DeclareSubstanceProperty { phase } -\DeclareSubstanceProperty {pKa} [\num] -\DeclareSubstanceProperty {pKa1} [\num] -\DeclareSubstanceProperty {pKa2} [\num] -\DeclareSubstanceProperty {pKb} [\num] -\DeclareSubstanceProperty {pKb1} [\num] -\DeclareSubstanceProperty {pKb2} [\num] -\DeclareSubstanceProperty { pictograms } [\substances_get_pics:n] -\DeclareSubstanceProperty { H } [\substances_get_ghs:nn{H}] -\DeclareSubstanceProperty { P } [\substances_get_ghs:nn{P}] -\DeclareSubstanceProperty { EUH } [\substances_get_ghs:nn{EUH}] -\DeclareSubstanceProperty {LD50} [\SI][{\milli\gram\per\kilo\gram}] +\DeclareSubstanceProperty {formula} [\ch] +\DeclareSubstanceProperty {structure} [\chemfig] +\DeclareSubstanceProperty {mass} [\SI][{\MolMass}] +\DeclareSubstanceProperty {bp} [\SI][{\celsius}] +\DeclareSubstanceProperty {mp} [\SI][{\celsius}] +\DeclareSubstanceProperty {density} [\SI][{{\gram\per\cubic\centi\metre}}] +\DeclareSubstanceProperty {phase} +\DeclareSubstanceProperty {pKa} [\num] +\DeclareSubstanceProperty {pKa1} [\num] +\DeclareSubstanceProperty {pKa2} [\num] +\DeclareSubstanceProperty {pKb} [\num] +\DeclareSubstanceProperty {pKb1} [\num] +\DeclareSubstanceProperty {pKb2} [\num] +\DeclareSubstanceProperty {pictograms} [\ghspictograms] +\DeclareSubstanceProperty {H} [\ghsstatements{H}] +\DeclareSubstanceProperty {P} [\ghsstatements{P}] +\DeclareSubstanceProperty {EUH} [\ghsstatements{EUH}] +\DeclareSubstanceProperty {LD50} [\SI][{{\milli\gram\per\kilo\gram}}] -\tex_endinput:D
\ No newline at end of file +\tex_endinput:D |