diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/chemformula/README | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/chemformula/chemformula_en.pdf | bin | 944504 -> 947308 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/chemformula/chemformula_en.tex | 65 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/chemformula/chemformula.sty | 107 |
4 files changed, 124 insertions, 52 deletions
diff --git a/Master/texmf-dist/doc/latex/chemformula/README b/Master/texmf-dist/doc/latex/chemformula/README index fd809c17048..8807db8c2b4 100644 --- a/Master/texmf-dist/doc/latex/chemformula/README +++ b/Master/texmf-dist/doc/latex/chemformula/README @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -the CHEMFORMULA package v4.9 2014/10/07 +the CHEMFORMULA package v4.10 2015/03/16 typeset chemical compounds and reactions @@ -8,7 +8,7 @@ Clemens Niederberger Web: https://github.com/cgnieder/chemformula/ E-Mail: contact@mychemistry.eu -------------------------------------------------------------------------- -Copyright 2011-2014 Clemens Niederberger +Copyright 2011-2015 Clemens Niederberger This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 diff --git a/Master/texmf-dist/doc/latex/chemformula/chemformula_en.pdf b/Master/texmf-dist/doc/latex/chemformula/chemformula_en.pdf Binary files differindex 2b644863b57..41dfc43e5a2 100644 --- a/Master/texmf-dist/doc/latex/chemformula/chemformula_en.pdf +++ b/Master/texmf-dist/doc/latex/chemformula/chemformula_en.pdf diff --git a/Master/texmf-dist/doc/latex/chemformula/chemformula_en.tex b/Master/texmf-dist/doc/latex/chemformula/chemformula_en.tex index e3ac37f0d05..a269504f99c 100644 --- a/Master/texmf-dist/doc/latex/chemformula/chemformula_en.tex +++ b/Master/texmf-dist/doc/latex/chemformula/chemformula_en.tex @@ -16,7 +16,7 @@ % If you have any ideas, questions, suggestions or bugs to report, please % feel free to contact me. % -------------------------------------------------------------------------- -% Copyright 2011-2013 Clemens Niederberger +% Copyright 2011-2015 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -44,14 +44,17 @@ \par } , add-cmds = { + bond, ce, ch, charrow, chcpd, chemformula@bondlength, chemsetup, chlewis, chname, DeclareChemArrow, DeclareChemBond, DeclareChemBondAlias, + DeclareChemCompoundProperty, mch, - NewChemArrow, NewChemBond, NewChemBondAlias, + NewChemArrow, NewChemBond, NewChemBondAlias, NewChemCompoundProperty, ox, OX, pch, - redox, RenewChemArrow, RenewChemBond, + redox, RemoveChemCompoundProperty, RenewChemArrow, RenewChemBond, + RenewChemCompoundProperty, setchemformula, ShowChemArrow, ShowChemBond } , add-silent-cmds = { @@ -183,10 +186,10 @@ \newname\hensel{Martin Hensel} -\BeforeBeginEnvironment{example}{\vspace{\baselineskip}} -\AfterEndEnvironment{example}{\vspace{\baselineskip}} -\BeforeBeginEnvironment{sourcecode}{\vspace{\baselineskip}} -\AfterEndEnvironment{sourcecode}{\vspace{\baselineskip}} +% \BeforeBeginEnvironment{example}{\vspace{\baselineskip}} +% \AfterEndEnvironment{example}{\vspace{\baselineskip}} +% \BeforeBeginEnvironment{sourcecode}{\vspace{\baselineskip}} +% \AfterEndEnvironment{sourcecode}{\vspace{\baselineskip}} \begin{document} @@ -275,6 +278,14 @@ then \chemmacros\ will not be loaded. The \chemmacros\ package, however, the output. \end{itemize} +\subsection{Version 4.10} +\begin{itemize} + \item new macros \cs{NewChemCompoundProperty}, + \cs{RenewChemCompoundProperty}, \\ + \cs{DeclareChemCompoundProperty} and \cs{RemoveChemCompoundProperty}. See + section~\ref{sec:extend-comp-prop} for a description. +\end{itemize} + \section{Licence and Requirements} \license @@ -882,6 +893,36 @@ You can change the distance between bond and atom, too: Typeset single compounds. \end{commands} +\subsection{Extend Compound Properties}\label{sec:extend-comp-prop} + +It\sinceversion{4.10} is possible to extend the range of special input symbols +within compounds. In the default setting those are \verbcode|*.-=+'| and +arabic numerals. Others can be added or the existing ones be changed with one +of the following commmands: +\begin{commands} + \command{NewChemCompoundProperty}[\marg{token}\marg{replacement}] + \meta{token} will be replaced by \meta{replacement} within compounds. The + property is only added if \meta{token} is not yet part the compounds' + property list. + \command{RenewChemCompoundProperty}[\marg{token}\marg{replacement}] + \meta{token} will be replaced by \meta{replacement} within compounds. The + property is only added if \meta{token} is already part the compounds' + property list. + \command{DeclareChemCompoundProperty}[\marg{token}\marg{replacement}] + \meta{token} will be replaced by \meta{replacement} within compounds. The + property silently overwrites any previously set \meta{replacement} for + \meta{token} if \meta{token} is already part the compounds' property + list. + \command{RemoveChemCompoundProperty}[\marg{token}] + Removes \meta{token} from the compounds' property list. +\end{commands} + +For example you can use +\begin{sourcecode} + \NewChemCompoundProperty{\}{\slash} +\end{sourcecode} +to allow line breaks after slashes in compounds. + \section{Special Input Types} There are some \enquote{special type} input groups. @@ -1499,11 +1540,11 @@ The next example shows the effect of some of the options: globally via the setup command or locally as option to \cs{ch}. \end{options} -With this option enabled several changes come into effect: \code{'} prodoces a -prime, a \code{x} in a superscript produces $\times$, and both a \code{.} and -a \code{*} produce a little filled circle. In the Kröger-Vink notation a prime -denotes a negative relative charge, the circle a positive relative charge, and -the cross denotes a neutral relative charge. +With this option enabled several changes come into effect: \verbcode|'| +produces a prime, a \code{x} in a superscript produces $\times$, and both a +\code{.} and a \code{*} produce a little filled circle. In the Kröger-Vink +notation a prime denotes a negative relative charge, the circle a positive +relative charge, and the cross denotes a neutral relative charge. \begin{example}[side-by-side,add-sourcecode-options={literate=}] \setchemformula{kroeger-vink=true} diff --git a/Master/texmf-dist/tex/latex/chemformula/chemformula.sty b/Master/texmf-dist/tex/latex/chemformula/chemformula.sty index 4bf964e34b0..692f90e5963 100644 --- a/Master/texmf-dist/tex/latex/chemformula/chemformula.sty +++ b/Master/texmf-dist/tex/latex/chemformula/chemformula.sty @@ -12,7 +12,7 @@ % If you have any ideas, questions, suggestions or bugs to report, please % feel free to contact me. % -------------------------------------------------------------------------- -% Copyright 2011-2014 Clemens Niederberger +% Copyright 2011-2015 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -28,8 +28,8 @@ % -------------------------------------------------------------------------- \RequirePackage{ expl3 , xparse , l3keys2e , tikz , amsmath , xfrac , nicefrac , scrlfile } \usetikzlibrary{arrows.meta} -\def\chemformula@version{4.9} -\def\chemformula@date{2014/10/07} +\def\chemformula@version{4.10} +\def\chemformula@date{2015/03/16} \ProvidesExplPackage {chemformula} @@ -289,6 +289,7 @@ % token lists: \tl_new:N \l__chemformula_compound_sep_tl \tl_set:Nn \l__chemformula_compound_sep_tl { .5em } +\tl_new:N \l__chemformula_compound_tl \tl_new:N \l__chemformula_arrow_ratio_tl \tl_set:Nn \l__chemformula_arrow_ratio_tl { .6 } \tl_new:N \l__chemformula_radical_style_tl @@ -1210,7 +1211,6 @@ \NewDocumentCommand \ch { O{}m } { \chemformula_ch:nn { #1 } { #2 } } -\tl_new:N \l__chemformula_compound_tl \cs_new_protected:Npn \chemformula_chcpd:nn #1#2 { \group_begin: @@ -1272,9 +1272,7 @@ \cs_new:Npn \chemformula_chwritebelow:nn #1#2 { -% \group_begin: -% \__chemformula_reset:Nn \l__chemformula_tmpa_tl { #1 } - \c_math_toggle_token + \c_math_toggle_token \underset { \bool_if:NF \l__chemformula_name_width_bool @@ -1287,8 +1285,7 @@ { \l__chemformula_name_format_tl #1 } } { \text { \strut #2 } } - \c_math_toggle_token -% \group_end: + \c_math_toggle_token } \cs_new_protected:Npn \__chemformula_generate_name:Nn #1#2 @@ -1314,22 +1311,50 @@ % -------------------------------------------------------------------------- % parsing input -\prop_put:Nnn \l__chemformula_cmpd_prop { 0 } { \chemformula_subscript:n { 0 } } -\prop_put:Nnn \l__chemformula_cmpd_prop { 1 } { \chemformula_subscript:n { 1 } } -\prop_put:Nnn \l__chemformula_cmpd_prop { 2 } { \chemformula_subscript:n { 2 } } -\prop_put:Nnn \l__chemformula_cmpd_prop { 3 } { \chemformula_subscript:n { 3 } } -\prop_put:Nnn \l__chemformula_cmpd_prop { 4 } { \chemformula_subscript:n { 4 } } -\prop_put:Nnn \l__chemformula_cmpd_prop { 5 } { \chemformula_subscript:n { 5 } } -\prop_put:Nnn \l__chemformula_cmpd_prop { 6 } { \chemformula_subscript:n { 6 } } -\prop_put:Nnn \l__chemformula_cmpd_prop { 7 } { \chemformula_subscript:n { 7 } } -\prop_put:Nnn \l__chemformula_cmpd_prop { 8 } { \chemformula_subscript:n { 8 } } -\prop_put:Nnn \l__chemformula_cmpd_prop { 9 } { \chemformula_subscript:n { 9 } } -\prop_put:Nnn \l__chemformula_cmpd_prop { * } { \chemformula_star_adduct: } -\prop_put:Nnn \l__chemformula_cmpd_prop { . } { \chemformula_adduct: } -\prop_put:Nnn \l__chemformula_cmpd_prop { - } { \chemformula_single_bond: } -\prop_put:Nnn \l__chemformula_cmpd_prop { = } { \chemformula_double_bond: } -\prop_put:Nnn \l__chemformula_cmpd_prop { + } { \chemformula_triple_bond: } -\prop_put:Nnn \l__chemformula_cmpd_prop { ' } { \chemformula_prime: } +% compounds: +\cs_new_protected:Npn \chemformula_new_compound_property:nn #1#2 + { \prop_put_if_new:Nnn \l__chemformula_cmpd_prop {#1} {#2} } + +\cs_new_protected:Npn \chemformula_renew_compound_property:nn #1#2 + { + \prop_if_in:NnT \l__chemformula_cmpd_prop {#1} + { \prop_put:Nnn \l__chemformula_cmpd_prop {#1} {#2} } + } + +\cs_new_protected:Npn \chemformula_declare_compound_property:nn #1#2 + { \prop_put:Nnn \l__chemformula_cmpd_prop {#1} {#2} } + +\cs_new_protected:Npn \chemformula_remove_compound_property:n #1 + { \prop_remove:Nn \l__chemformula_cmpd_prop {#1} } + +\NewDocumentCommand \NewChemCompoundProperty { mm } + { \chemformula_new_compound_property:nn {#1} {#2} } + +\NewDocumentCommand \RenewChemCompoundProperty { mm } + { \chemformula_renew_compound_property:nn {#1} {#2} } + +\NewDocumentCommand \DeclareChemCompoundProperty { mm } + { \chemformula_declare_compound_property:nn {#1} {#2} } + +\NewDocumentCommand \RemoveChemCompoundProperty { m} + { \chemformula_remove_compound_property:n {#1} } + +\chemformula_new_compound_property:nn { 0 } { \chemformula_subscript:n { 0 } } +\chemformula_new_compound_property:nn { 1 } { \chemformula_subscript:n { 1 } } +\chemformula_new_compound_property:nn { 2 } { \chemformula_subscript:n { 2 } } +\chemformula_new_compound_property:nn { 3 } { \chemformula_subscript:n { 3 } } +\chemformula_new_compound_property:nn { 4 } { \chemformula_subscript:n { 4 } } +\chemformula_new_compound_property:nn { 5 } { \chemformula_subscript:n { 5 } } +\chemformula_new_compound_property:nn { 6 } { \chemformula_subscript:n { 6 } } +\chemformula_new_compound_property:nn { 7 } { \chemformula_subscript:n { 7 } } +\chemformula_new_compound_property:nn { 8 } { \chemformula_subscript:n { 8 } } +\chemformula_new_compound_property:nn { 9 } { \chemformula_subscript:n { 9 } } +\chemformula_new_compound_property:nn { * } { \chemformula_star_adduct: } +\chemformula_new_compound_property:nn { . } { \chemformula_adduct: } +\chemformula_new_compound_property:nn { - } { \chemformula_single_bond: } +\chemformula_new_compound_property:nn { = } { \chemformula_double_bond: } +\chemformula_new_compound_property:nn { + } { \chemformula_triple_bond: } +\chemformula_new_compound_property:nn { ' } { \chemformula_prime: } % numbers \prop_put:Nnn \l__chemformula_numbers_prop { 0 } { 0 } @@ -1975,24 +2000,26 @@ { \bool_set_true:N \l__chemformula_stoich_bool % the factor consists only of a parenthesis or a decimal marcer: - \bool_set_true:N \l__chemformula_no_stoich_bool + % \bool_set_true:N \l__chemformula_no_stoich_bool + % \tl_map_inline:nn { #1 } + % { + % \prop_if_in:NnF \l__chemformula_no_stoich_prop { ##1 } + % { \bool_set_false:N \l__chemformula_no_stoich_bool } + % } + % \bool_if:NF \l__chemformula_no_stoich_bool + % { \tl_map_inline:nn { #1 } { - \prop_get:NnNF \l__chemformula_no_stoich_prop { ##1 } \l__chemformula_tmpa_tl - { \bool_set_false:N \l__chemformula_no_stoich_bool } - } - \bool_if:NF \l__chemformula_no_stoich_bool - { - \tl_map_inline:nn { #1 } + \prop_get:NnNTF \l__chemformula_stoich_prop { ##1 } \l__chemformula_tmpa_tl { - \prop_get:NnNTF \l__chemformula_stoich_prop { ##1 } \l__chemformula_tmpa_tl - { - \bool_if:NT \l__chemformula_stoich_bool - { \tl_put_right:NV \l__chemformula_stoich_tl \l__chemformula_tmpa_tl } - } - { \bool_set_false:N \l__chemformula_stoich_bool } + % \bool_if:NT \l__chemformula_stoich_bool + % { + \tl_put_right:NV \l__chemformula_stoich_tl \l__chemformula_tmpa_tl + % } } + { \bool_set_false:N \l__chemformula_stoich_bool } } + % } \bool_if:NTF \l__chemformula_stoich_bool { \tl_if_blank:VF \l__chemformula_stoich_tl @@ -3122,6 +3149,10 @@ VERSION HISTORY package 2014/10/07 - version 4.9 - new options: `minus-space', `minus-penalty', `plus-output-symbol' and `minus-output-symbol' +2015/03/16 - version 4.10 - new macros \NewChemCompoundProperty, + \RenewChemCompoundProperty, + \DeclareChemCompoundProperty, + \RemoveChemCompoundProperty % -------------------------------------------------------------------------- % TODO |