diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex')
4 files changed, 318 insertions, 92 deletions
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty b/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty index b29047b1e3d..d041025fe17 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty +++ b/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty @@ -27,8 +27,8 @@ % -------------------------------------------------------------------------- \RequirePackage{ expl3 , xparse , l3keys2e , tikz , amsmath , xfrac , nicefrac , scrlfile } \usetikzlibrary{arrows} -\def\chemformula@version{4.0} -\def\chemformula@date{2013/07/06} +\def\chemformula@version{4.1} +\def\chemformula@date{2013/08/24} \ProvidesExplPackage {chemformula} @@ -167,7 +167,7 @@ % variants of kernel functions: \cs_generate_variant:Nn \keys_set:nn { nV } \cs_generate_variant:Nn \tl_if_blank:nF { V } -\cs_generate_variant:Nn \tl_if_in:nnT { x } +\cs_generate_variant:Nn \tl_if_in:nnT { x , nV } \cs_generate_variant:Nn \prop_get:Nn { NV } \cs_generate_variant:Nn \tl_set_rescan:Nnn { NnV } @@ -248,6 +248,8 @@ \bool_new:N \l__chemformula_fss_shape_bool \bool_new:N \l__chemformula_name_width_bool \bool_new:N \l__chemformula_charge_full_shift_bool +\bool_new:N \l__chemformula_tikzexternaldisable_bool +\bool_set_true:N \l__chemformula_tikzexternaldisable_bool % dimensions: \dim_new:N \l__chemformula_arrow_length_dim @@ -311,6 +313,12 @@ \tl_set:Nn \l__chemformula_arrow_label_style_tl { \footnotesize } \tl_new:N \l__chemformula_arrow_tmp_tl \tl_new:N \l__chemformula_arrow_type_tl +\tl_new:N \l__chemformula_arrow_penalty_tl +\tl_set:Nn \l__chemformula_arrow_penalty_tl { 0 } +\tl_new:N \l__chemformula_plus_penalty_tl +\tl_set:Nn \l__chemformula_plus_penalty_tl { 700 } +\tl_new:N \l__chemformula_bond_penalty_tl +\tl_set:Nn \l__chemformula_bond_penalty_tl { 10000 } \tl_new:N \l__chemformula_name_tmp_tl \tl_new:N \l__chemformula_chemformula_tmpa_tl \tl_new:N \g__chemformula_options_tl @@ -385,6 +393,15 @@ \chemformula_nobreak: } +\cs_new_protected:Npn \chemformula_skip_nobreak_penalty:Nn #1#2 + { + \chemformula_nobreak: + \skip_horizontal:N #1 + \tex_penalty:D #2 \scan_stop: + } +% \binoppenalty=\maxdimen +% \relpenalty=\maxdimen + \cs_new_protected:Npn \chemformula_dim_to_width:Nn #1#2 { \hbox_set:Nn \l__chemformula_tmpa_box { #2 } @@ -399,6 +416,22 @@ { \use:c { if #1 } \prg_return_true: \else: \prg_return_false: \fi: } % -------------------------------------------------------------------------- +% prevent externalisation of tikz parts of the formulae: +\AtBeginDocument { \providecommand \tikzexternaldisable {} } + +\keys_define:nn { chemmacros / chemformula } + { + tikz-external-disable .bool_set:N = + \l__chemformula_tikzexternaldisable_bool + } + +\cs_new_protected:Npn \chemformula_tikzexternaldisable: + { + \bool_if:NT \l__chemformula_tikzexternaldisable_bool + { \tikzexternaldisable } + } + +% -------------------------------------------------------------------------- % circled charge signs: \cs_new_protected:Npn \chemformula_fplus: { \ensuremath { \__chemformula_fplus: } } @@ -645,9 +678,9 @@ { \dim_set_eq:NN \l__chemformula_arrow_length_dim \l__chemformula_tmpa_dim } { \dim_set_eq:NN \l__chemformula_arrow_length_dim \l__chemformula_tmpb_dim } \dim_add:Nn \l__chemformula_arrow_length_dim - { \l__chemformula_arrow_offset_dim } - \dim_add:Nn \l__chemformula_arrow_length_dim - { \l__chemformula_arrow_offset_dim } + { 2\l__chemformula_arrow_offset_dim } +% \dim_add:Nn \l__chemformula_arrow_length_dim +% { \l__chemformula_arrow_offset_dim } \dim_compare:nF { \l__chemformula_arrow_length_dim > \l__chemformula_arrow_minimum_length_dim } { @@ -657,15 +690,12 @@ } \dim_set:Nn \l__chemformula_arrow_shortage_dim { - \l__chemformula_arrow_length_dim * - \dim_ratio:nn { \l__chemformula_arrow_ratio_tl pt } { 1pt } - } - \dim_set:Nn \l__chemformula_arrow_shortage_dim - { \l__chemformula_arrow_length_dim - \l__chemformula_arrow_shortage_dim } - \dim_set:Nn \l__chemformula_arrow_shortage_dim - { - \l__chemformula_arrow_shortage_dim * - \dim_ratio:nn { 1pt } { 2pt } + ( + \l__chemformula_arrow_length_dim + - + \l__chemformula_arrow_length_dim * + \dim_ratio:nn { \l__chemformula_arrow_ratio_tl pt } { 1pt } + ) * 1/2 } } @@ -701,14 +731,17 @@ % this will be \arrow inside \ch \DeclareDocumentCommand \charrow { mO{}O{} } { - \__chemformula_arrows_get:n { #1 } - \chemformula_arrow_labels:nn { #2 } { #3 } + \group_begin: + \chemformula_tikzexternaldisable: + \__chemformula_arrows_get:n { #1 } + \chemformula_arrow_labels:nn { #2 } { #3 } + \group_end: } % draw the arrows \cs_new:Npn \__chemformula_arrow_draw:n #1 { - \chemformula_allow_break: + \chemformula_nobreak: % prepare arrow code for drawing: \tl_set_rescan:Nnn \l__chemformula_tmpc_tl { \char_set_catcode_letter:N \_ } { #1 } @@ -723,18 +756,18 @@ \chemformula_draw:xn { \l__chemformula_arrow_style_tl } { - coordinate (chemformula_arrow_start) (0,0) - ++ (\l__chemformula_compound_sep_dim,.3432em) - ++ (0,\l__chemformula_arrow_yshift_dim) + coordinate (chemformula_arrow_start) (0pt,0pt) + ++ ( \l__chemformula_compound_sep_dim , .3432em) + ++ (0pt,\l__chemformula_arrow_yshift_dim) coordinate (cf_arrow_start) - ++ ( .5 * \dim_use:N \l__chemformula_arrow_length_dim , 0) + ++ ( .5 * \dim_use:N \l__chemformula_arrow_length_dim , 0pt) coordinate (cf_arrow_mid) - ++ ( .5 * \dim_use:N \l__chemformula_arrow_length_dim , 0) + ++ ( .5 * \dim_use:N \l__chemformula_arrow_length_dim , 0pt) coordinate (cf_arrow_end) - ++ (\l__chemformula_compound_sep_dim,0) - (cf_arrow_start) ++ (\l__chemformula_arrow_shortage_dim,0) + ++ ( \l__chemformula_compound_sep_dim , 0pt ) + (cf_arrow_start) ++ (\l__chemformula_arrow_shortage_dim , 0pt) coordinate (cf_arrow_mid_start) - (cf_arrow_end) ++ (-\l__chemformula_arrow_shortage_dim , 0) + (cf_arrow_end) ++ (-\l__chemformula_arrow_shortage_dim , 0pt) coordinate (cf_arrow_mid_end) } % the arrow labels: @@ -748,7 +781,9 @@ ; \tl_use:N \l__chemformula_tmpc_tl } - \chemformula_allow_break: + \chemformula_skip_nobreak_penalty:Nn + \c_zero_skip + { \l__chemformula_arrow_penalty_tl } } \cs_generate_variant:Nn \__chemformula_arrow_draw:n { V } @@ -844,7 +879,8 @@ label-offset .dim_set:N = \l__chemformula_arrow_label_offset_dim , compound-sep .dim_set:N = \l__chemformula_compound_sep_dim , arrow-style .tl_set:N = \l__chemformula_arrow_style_tl , - label-style .tl_set:N = \l__chemformula_arrow_label_style_tl + label-style .tl_set:N = \l__chemformula_arrow_label_style_tl , + arrow-penalty .tl_set:N = \l__chemformula_arrow_penalty_tl } % -------------------------------------------------------------------------- @@ -1000,7 +1036,7 @@ \prop_map_inline:Nn \l__chemformula_arrows_code_prop { \tl_set_rescan:Nnn \l__chemformula_tmpa_tl {} { ##1 } - \tl_if_in:noT { #1 } { \l__chemformula_tmpa_tl } + \tl_if_in:nVT { #1 } \l__chemformula_tmpa_tl { \bool_set_true:N \l__chemformula_is_arrow_bool } } } @@ -1143,25 +1179,30 @@ \cs_new_protected:Npn \chemformula_bond:n #1 { \chemformula_skip_nobreak:N \l__chemformula_bond_space_dim + \group_begin: + \chemformula_tikzexternaldisable: \chemformula_tikz:nn { - inner~sep = 0 , - outer~sep = 0 , + inner~sep = 0pt , + outer~sep = 0pt , text~height = 1em , baseline = (chemformula-bond-ground.base) } { \draw node[draw=none,minimum~height=1em,minimum~width=0] - (chemformula-bond-ground) at (0,0) {}; - \draw (chemformula-bond-ground) ++ (0,-.1716em) + (chemformula-bond-ground) at (0pt,0pt) {}; + \draw (chemformula-bond-ground) ++ (0pt,-.1716em) coordinate (chemformula-bond-start) ; - \draw (chemformula-bond-start) ++(\l__chemformula_bond_dim ,0) + \draw (chemformula-bond-start) ++(\l__chemformula_bond_dim ,0pt) coordinate (chemformula-bond-end) ; \tl_if_blank:nTF { #1 } { \__chemformula_bond_draw:n { single } } { \__chemformula_bond_draw:n { #1 } } } - \chemformula_skip_nobreak:N \l__chemformula_bond_space_dim + \group_end: + \chemformula_skip_nobreak_penalty:Nn + \l__chemformula_bond_space_dim + { \l__chemformula_bond_penalty_tl } } \cs_new_protected:Npn \__chemformula_bond_draw:n #1 @@ -1222,10 +1263,10 @@ \DeclareChemBond{double} { - \draw (chemformula-bond-start) ++ (0,.0858em) coordinate (double-start-up) ; - \draw (chemformula-bond-end) ++ (0,.0858em) coordinate (double-end-up) ; - \draw (chemformula-bond-start) ++ (0,-.0858em) coordinate (double-start-down) ; - \draw (chemformula-bond-end) ++ (0,-.0858em) coordinate (double-end-down) ; + \draw (chemformula-bond-start) ++ (0pt,.0858em) coordinate (double-start-up) ; + \draw (chemformula-bond-end) ++ (0pt,.0858em) coordinate (double-end-up) ; + \draw (chemformula-bond-start) ++ (0pt,-.0858em) coordinate (double-start-down) ; + \draw (chemformula-bond-end) ++ (0pt,-.0858em) coordinate (double-end-down) ; \draw[chembond] (double-start-down) -- (double-end-down) (double-start-up) -- (double-end-up) ; @@ -1234,10 +1275,10 @@ \DeclareChemBond{semidouble} { - \draw (chemformula-bond-start) ++ (0,.0858em) coordinate (double-start-up) ; - \draw (chemformula-bond-end) ++ (0,.0858em) coordinate (double-end-up) ; - \draw (chemformula-bond-start) ++ (0,-.0858em) coordinate (double-start-down) ; - \draw (chemformula-bond-end) ++ (0,-.0858em) coordinate (double-end-down) ; + \draw (chemformula-bond-start) ++ (0pt,.0858em) coordinate (double-start-up) ; + \draw (chemformula-bond-end) ++ (0pt,.0858em) coordinate (double-end-up) ; + \draw (chemformula-bond-start) ++ (0pt,-.0858em) coordinate (double-start-down) ; + \draw (chemformula-bond-end) ++ (0pt,-.0858em) coordinate (double-end-down) ; \draw[chembond] (double-start-down) -- (double-end-down) ; \draw[chembond,densely~dotted] (double-start-up) -- (double-end-up) ; } @@ -1247,10 +1288,10 @@ \DeclareChemBond{triple} { - \draw (chemformula-bond-start) ++ (0,.1287em) coordinate (triple-start-up) ; - \draw (chemformula-bond-end) ++ (0,.1287em) coordinate (triple-end-up) ; - \draw (chemformula-bond-start) ++ (0,-.1287em) coordinate (triple-start-down) ; - \draw (chemformula-bond-end) ++ (0,-.1287em) coordinate (triple-end-down) ; + \draw (chemformula-bond-start) ++ (0pt,.1287em) coordinate (triple-start-up) ; + \draw (chemformula-bond-end) ++ (0pt,.1287em) coordinate (triple-end-up) ; + \draw (chemformula-bond-start) ++ (0pt,-.1287em) coordinate (triple-start-down) ; + \draw (chemformula-bond-end) ++ (0pt,-.1287em) coordinate (triple-end-down) ; \draw[chembond] (triple-start-down) -- (triple-end-down) (chemformula-bond-start) -- (chemformula-bond-end) @@ -1260,10 +1301,10 @@ \DeclareChemBond{semitriple} { - \draw (chemformula-bond-start) ++ (0,.1287em) coordinate (triple-start-up) ; - \draw (chemformula-bond-end) ++ (0,.1287em) coordinate (triple-end-up) ; - \draw (chemformula-bond-start) ++ (0,-.1287em) coordinate (triple-start-down) ; - \draw (chemformula-bond-end) ++ (0,-.1287em) coordinate (triple-end-down) ; + \draw (chemformula-bond-start) ++ (0pt,.1287em) coordinate (triple-start-up) ; + \draw (chemformula-bond-end) ++ (0pt,.1287em) coordinate (triple-end-up) ; + \draw (chemformula-bond-start) ++ (0pt,-.1287em) coordinate (triple-start-down) ; + \draw (chemformula-bond-end) ++ (0pt,-.1287em) coordinate (triple-end-down) ; \draw[chembond] (triple-start-down) -- (triple-end-down) (chemformula-bond-start) -- (chemformula-bond-end) ; @@ -1649,6 +1690,7 @@ \tl_if_blank:VF \l__chemformula_stoich_tl { \tl_put_left:Nn \l__chemformula_stoich_tl { \chemformula_font_inner: } + % TODO: is \ExplSyntaxOn needed here? \tl_set_rescan:Nno \l__chemformula_stoich_tl { \ExplSyntaxOn } { \l__chemformula_stoich_tl } @@ -1733,6 +1775,8 @@ \tl_put_right:Nn \l__chemformula_input_tl { ) } } +\cs_new_eq:NN \chemformula_math_frac:nn \frac + \cs_new:Npn \__chemformula_frac:nn #1#2 { \bool_if:NT \l__chemformula_xfrac_bool @@ -1740,7 +1784,7 @@ \bool_if:NT \l__chemformula_nicefrac_bool { \nicefrac{#1}{#2} } \bool_if:NT \l__chemformula_mathfrac_bool - { \( \frac{ \text { #1 } } { \text { #2 } } \) } + { \( \chemformula_math_frac:nn { \text { #1 } } { \text { #2 } } \) } } \cs_new:Npn \__chemformula_misc_frac:nnn #1#2#3 @@ -1750,7 +1794,7 @@ \bool_if:NT \l__chemformula_nicefrac_bool { #1\nicefrac{#2}{#3} } \bool_if:NT \l__chemformula_mathfrac_bool - { #1 \( \frac{ \text { #2 } } { \text { #3 } } \) } + { #1 \( \chemformula_math_frac:nn { \text { #2 } } { \text { #3 } } \) } } % -------------------------------------------------------------------------- @@ -1955,7 +1999,9 @@ { \chemformula_skip_nobreak:N \l__chemformula_plus_space_skip + - \skip_horizontal:N \l__chemformula_plus_space_skip + \chemformula_skip_nobreak_penalty:Nn + \l__chemformula_plus_space_skip + { \l__chemformula_plus_penalty_tl } } } \bool_set_false:N \l__chemformula_is_plus_bool @@ -2211,10 +2257,13 @@ \bool_set_false:N \l__chemformula_xfrac_bool \bool_set_true:N \l__chemformula_nicefrac_bool \bool_set_false:N \l__chemformula_mathfrac_bool , + frac-math-cmd .code:n = + { \cs_set_eq:NN \chemformula_math_frac:nn #1 } , stoich-paren-parse .bool_set:N = \l__chemformula_stoich_parse_iupac_bool , stoich-space .skip_set:N = \l__chemformula_stoich_space_skip , adduct-space .dim_set:N = \l__chemformula_adduct_space_dim , plus-space .skip_set:N = \l__chemformula_plus_space_skip , + plus-penalty .tl_set:N = \l__chemformula_plus_penalty_tl , math-space .skip_set:N = \l__chemformula_math_space_skip , name-format .tl_set:N = \l__chemformula_name_format_tl , name-width .code:n = @@ -2229,6 +2278,7 @@ bond-length .dim_set:N = \l__chemformula_bond_dim , bond-offset .dim_set:N = \l__chemformula_bond_space_dim , bond-style .tl_set:N = \l__chemformula_bond_style_tl , + bond-penalty .tl_set:N = \l__chemformula_bond_penalty_tl , font-family .code:n = \bool_set_true:N \l__chemformula_fss_bool \bool_set_false:N \l__chemformula_fontspec_bool @@ -2371,8 +2421,23 @@ VERSION HISTORY - don't allow a line break between a stoichiometric factor and a compound - changed formal charges to match ``plain'' charges +2013/07/26 - version 4.0a - added options `arrow-penalty' (0), `plus-penalty' + (700) and `bond-penalty' (10000) that determine if + there may be a break after an arrow, a bond or the + plus +2013/08/24 - version 4.1 - changed `0' values in TikZ coordinates into `0pt' + see http://tex.stackexchange.com/q/128792/5049 and + http://tex.stackexchange.com/q/118467/5049 for + reference + - new option `tikz-external-disable' + - new option `frac-math-cmd' + % -------------------------------------------------------------------------- % TODO +- add \tikzexternaldisable and an option to disable it to \ch, \chcpd, + \charrow, and \bond - Addukte: Zahlen nach * und . automatisch erkennen? - optionale Argumente von \\ nach außen weiterreichen? +- zu `frac-style' die Möglichkeit einbauen, statt \frac, \dfrac oder \tfrac zu + verwenden. diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemgreek.sty b/Master/texmf-dist/tex/latex/chemmacros/chemgreek.sty index dc072de4205..9bb67b76e9f 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemgreek.sty +++ b/Master/texmf-dist/tex/latex/chemmacros/chemgreek.sty @@ -26,8 +26,8 @@ % - The Current Maintainer of this work is Clemens Niederberger. % ---------------------------------------------------------------------------- \RequirePackage{expl3,xparse} -\def\chemgreek@version{0.1a} -\def\chemgreek@date{2013/07/06} +\def\chemgreek@version{0.2} +\def\chemgreek@date{2013/08/24} \ProvidesExplPackage{chemgreek}{\chemgreek@date}{\chemgreek@version} {interface for upright greek letters for use in chemistry (CN)} @@ -41,6 +41,13 @@ \int_new:N \g__chemgreek_tmpa_int % ---------------------------------------------------------------------------- +% an l3 conditional that can test 2e's conditionals that go like +% \iffoo ... \else ... \fi +% see http://tex.stackexchange.com/a/119806/5049 +\prg_new_conditional:Npnn \chemgreek_latex_if:n #1 {p,T,F,TF} + { \use:c { if #1 } \prg_return_true: \else: \prg_return_false: \fi: } + +% ---------------------------------------------------------------------------- % messages \msg_new:nnnn { chemgreek } { mapping-not-defined } { The~ mapping~ `#1'~ does~ not~ exist~ \msg_line_context: } @@ -256,6 +263,71 @@ \cs_new_eq:NN \showchemgreekmapping \chemgreek_show_mapping:n % ---------------------------------------------------------------------------- +% functions to format integers with greek letters; these are basically copies +% of \int_to_alph:n +\cs_new:Npn \chemgreek_int_to_greek:n #1 + { + \int_to_symbols:nnn { #1 } { 24 } + { + { 1 } { \Chemalpha } + { 2 } { \Chembeta } + { 3 } { \Chemgamma } + { 4 } { \Chemdelta } + { 5 } { \Chemepsilon } + { 6 } { \Chemzeta } + { 7 } { \Chemeta } + { 8 } { \Chemiota } + { 9 } { \Chemtheta } + { 10 } { \Chemkappa } + { 11 } { \Chemlambda } + { 12 } { \Chemmu } + { 13 } { \Chemnu } + { 14 } { \Chemxi } + { 15 } { \Chemomikron } + { 16 } { \Chempi } + { 17 } { \Chemrho } + { 18 } { \Chemsigma } + { 19 } { \Chemtau } + { 20 } { \Chemupsilon } + { 21 } { \Chemphi } + { 22 } { \Chempsi } + { 23 } { \Chemchi } + { 24 } { \Chemomega } + } + } + +\cs_new:Npn \chemgreek_int_to_Greek:n #1 + { + \int_to_symbols:nnn { #1 } { 24 } + { + { 1 } { \ChemAlpha } + { 2 } { \ChemBeta } + { 3 } { \ChemGamma } + { 4 } { \ChemDelta } + { 5 } { \ChemEpsilon } + { 6 } { \ChemZeta } + { 7 } { \ChemEta } + { 8 } { \ChemIota } + { 9 } { \ChemTheta } + { 10 } { \ChemKappa } + { 11 } { \ChemLambda } + { 12 } { \ChemMu } + { 13 } { \ChemNu } + { 14 } { \ChemXi } + { 15 } { \ChemOmikron } + { 16 } { \ChemPi } + { 17 } { \ChemRho } + { 18 } { \ChemSigma } + { 19 } { \ChemTau } + { 20 } { \ChemUpsilon } + { 21 } { \ChemPhi } + { 22 } { \ChemPsi } + { 23 } { \ChemChi } + { 24 } { \ChemOmega } + } + } + +% ---------------------------------------------------------------------------- % predefine some mappings % default: \chemgreek_new_mapping:nn { default } @@ -315,6 +387,35 @@ \ensuremath{\omega} / \ensuremath{\Omega} % 24 } +% mathdesign: +\chemgreek_new_mapping:nn { mathdesign } + { + \ensuremath{\alphaup} / \ensuremath{\mathrm{A}} , % 1 + \ensuremath{\betaup} / \ensuremath{\mathrm{B}} , % 2 + \ensuremath{\gammaup} / \ensuremath{\Gammaup} , % 3 + \ensuremath{\deltaup} / \ensuremath{\Deltaup} , % 4 + \ensuremath{\epsilonup} / \ensuremath{\mathrm{E}} , % 5 + \ensuremath{\zetaup} / \ensuremath{\mathrm{Z}} , % 6 + \ensuremath{\etaup} / \ensuremath{\mathrm{H}} , % 7 + \ensuremath{\thetaup} / \ensuremath{\Thetaup} , % 8 + \ensuremath{\iotaup} / \ensuremath{\mathrm{I}} , % 9 + \ensuremath{\kappaup} / \ensuremath{\mathrm{K}} , % 10 + \ensuremath{\lambdaup} / \ensuremath{\Lambdaup} , % 11 + \ensuremath{\muup} / \ensuremath{\mathrm{M}} , % 12 + \ensuremath{\nuup} / \ensuremath{\mathrm{N}} , % 13 + \ensuremath{\xiup} / \ensuremath{\Xiup} , % 14 + \ensuremath{\mathrm{o}} / \ensuremath{\mathrm{O}} , % 15 + \ensuremath{\piup} / \ensuremath{\Piup} , % 16 + \ensuremath{\rhoup} / \ensuremath{\mathrm{R}} , % 17 + \ensuremath{\sigmaup} / \ensuremath{\Sigmaup} , % 18 + \ensuremath{\tauup} / \ensuremath{\mathrm{T}} , % 19 + \ensuremath{\upsilonup} / \ensuremath{\Upsilonup} , % 20 + \ensuremath{\phiup} / \ensuremath{\Phiup} , % 21 + \ensuremath{\psiup} / \ensuremath{\Psiup} , % 22 + \ensuremath{\chiup} / \ensuremath{\mathrm{X}} , % 23 + \ensuremath{\omegaup} / \ensuremath{\Omegaup} % 24 + } + % textgreek: \chemgreek_new_mapping:nn { textgreek } { @@ -431,6 +532,49 @@ \ensuremath{\upomega} / \ensuremath{\upOmega} % 24 } +% fourier: +\cs_new:Npn \__chemgreek_lfourier:n #1 + { + \chemgreek_latex_if:nTF { sloped } + { \ensuremath { \use:c { other #1 } } } + { \ensuremath { \use:c { #1 } } } + } + +\cs_new:Npn \__chemgreek_ufourier:n #1 + { + \chemgreek_latex_if:nTF { sloped } + { \ensuremath { \use:c { #1 } } } + { \ensuremath { \use:c { other #1 } } } + } + +\chemgreek_new_mapping:nn { fourier } + { + \__chemgreek_lfourier:n {alpha} / \ensuremath{\mathrm{A}} , % 1 + \__chemgreek_lfourier:n {beta} / \ensuremath{\mathrm{B}} , % 2 + \__chemgreek_lfourier:n {gamma} / \__chemgreek_upper_fourier:n {Gamma} , % 3 + \__chemgreek_lfourier:n {delta} / \__chemgreek_upper_fourier:n {Delta} , % 4 + \__chemgreek_lfourier:n {epsilon} / \ensuremath{\mathrm{E}} , % 5 + \__chemgreek_lfourier:n {zeta} / \ensuremath{\mathrm{Z}} , % 6 + \__chemgreek_lfourier:n {eta} / \ensuremath{\mathrm{H}} , % 7 + \__chemgreek_lfourier:n {theta} / \__chemgreek_upper_fourier:n {Theta} , % 8 + \__chemgreek_lfourier:n {iota} / \ensuremath{\mathrm{I}} , % 9 + \__chemgreek_lfourier:n {kappa} / \ensuremath{\mathrm{K}} , % 10 + \__chemgreek_lfourier:n {lambda} / \__chemgreek_upper_fourier:n {Lambda} , % 11 + \__chemgreek_lfourier:n {mu} / \ensuremath{\mathrm{M}} , % 12 + \__chemgreek_lfourier:n {nu} / \ensuremath{\mathrm{N}} , % 13 + \__chemgreek_lfourier:n {xi} / \__chemgreek_upper_fourier:n {Xi} , % 14 + \ensuremath {\mathrm{o}} / \ensuremath{\mathrm{O}} , % 15 + \__chemgreek_lfourier:n {pi} / \__chemgreek_upper_fourier:n {Pi} , % 16 + \__chemgreek_lfourier:n {rho} / \ensuremath{\mathrm{R}} , % 17 + \__chemgreek_lfourier:n {sigma} / \__chemgreek_upper_fourier:n {Sigma} , % 18 + \__chemgreek_lfourier:n {tau} / \ensuremath{\mathrm{T}} , % 19 + \__chemgreek_lfourier:n {upsilon} / \__chemgreek_upper_fourier:n {Upsilon} , % 20 + \__chemgreek_lfourier:n {phi} / \__chemgreek_upper_fourier:n {Phi} , % 21 + \__chemgreek_lfourier:n {psi} / \__chemgreek_upper_fourier:n {Psi} , % 22 + \__chemgreek_lfourier:n {chi} / \ensuremath{\mathrm{X}} , % 23 + \__chemgreek_lfourier:n {omega} / \__chemgreek_ufourier:n {Omega} % 24 + } + % activate default mapping \chemgreek_activate_mapping:n { default } @@ -441,3 +585,6 @@ HISTORY: 2013/07/06 - v0.1a - fixed stupid bug in `upgreek' mapping - added error messages and added \renewchemgreekmapping and \declarechemgreekmapping +2013/08/24 - v0.2 - new mappings `mathdesign', `fourier' + - new functions: \chemgreek_int_to_greek:n and + \chemgreek_int_to_Greek:n diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty index a1c7aa6c46f..26cb76ea4ab 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty +++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty @@ -26,8 +26,8 @@ % - The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- \RequirePackage{ expl3 , xparse , l3keys2e } -\def\chemmacros@version{4.0} -\def\chemmacros@date{2013/07/06} +\def\chemmacros@version{4.1} +\def\chemmacros@date{2013/08/24} \ProvidesExplPackage {chemmacros} @@ -1037,20 +1037,24 @@ \ExplSyntaxOff \protected\def\chemmacros@sconf#1% {% + \begingroup \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); }% + \endgroup } \protected\def\chemmacros@rconf#1% {% + \begingroup \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) ; }% + \endgroup } \ExplSyntaxOn @@ -1074,9 +1078,9 @@ \DeclareChemIUPAC \L { \textsc { l } } % ortho/meta/para -\DeclareChemIUPAC \ortho { \textsl { o } } -\DeclareChemIUPAC \meta { \textsl { m } } -\DeclareChemIUPAC \para { \textsl { p } } +\DeclareChemIUPAC \ortho { \textit { o } } +\DeclareChemIUPAC \meta { \textit { m } } +\DeclareChemIUPAC \para { \textit { p } } % syn/anti \DeclareChemIUPAC \syn { \textit { syn } } @@ -1758,8 +1762,10 @@ { \chemformula_latex_if:nTF { measuring@ } { + \group_begin: \tikz[baseline=(#1.base)] - { \node [inner~sep=0] (#1) { #2 } ; } + { \node [inner~sep=0pt] (#1) { #2 } ; } + \group_end: } { \tl_if_blank:nT { #1 } @@ -1767,7 +1773,7 @@ \tl_if_blank:nT { #2 } { \msg_error:nnx { chemmacros } { OX } { atom~missing } } \tikz[baseline=(#1.base),remember~picture] - { \node [inner~sep=0] (#1) { #2 } ; } + { \node [inner~sep=0pt] (#1) { #2 } ; } } } @@ -2311,7 +2317,7 @@ { \exp_not:N \chemmacros_translate:nn { phase-\l__chemmacros_tmpa_tl } - { #2 } + { \exp_not:n { #2 } } } } @@ -2326,7 +2332,7 @@ { \exp_not:N \chemmacros_translate:nn { phase-\l__chemmacros_tmpa_tl } - { #2 } + { \exp_not:n { #2 } } } } @@ -2594,7 +2600,7 @@ % the `chemstyle' provides it with \providecommand so it doesn't matter which % package defines it first \ProvideDocumentCommand \standardstate {} - { \ensuremath { \chemmacros_standardstate: } } + { { \ensuremath { \chemmacros_standardstate: } } } \cs_new_protected:Npn \chemmacros_standardstate: { \mathpalette \chemmacros_standardstate_aux: \circ } @@ -2970,14 +2976,14 @@ scale = \fp_to_tl:N \l__chemmacros_newman_scale_fp , chemmacros_newman_atom_front / .style = { - inner~sep=0, - outer~sep=0, + inner~sep=0pt, + outer~sep=0pt, \tl_use:N \l__chemmacros_newman_tikz_front_tl }, chemmacros_newman_atom_back / .style = { - inner~sep=0, - outer~sep=0, + inner~sep=0pt, + outer~sep=0pt, \bool_if:NTF \l__chemmacros_newman_tikz_back_bool { \tl_use:N \l__chemmacros_newman_tikz_back_tl } { \tl_use:N \l__chemmacros_newman_tikz_front_tl } @@ -2986,7 +2992,7 @@ { \chemmacros_tikz_draw:f { \tl_use:N \l__chemmacros_newman_tikz_ring_tl } - (0,0) circle (\fp_to_dim:N \l__chemmacros_newman_scale_fp * 15) ; + (0pt,0pt) circle (\fp_to_dim:N \l__chemmacros_newman_scale_fp * 15) ; \chemmacros_newman_back_node:nn { 30 } { \IfNoValueF { #6 } { #6 } } @@ -3070,7 +3076,7 @@ { \l__chemmacros_newman_scale_fp } \chemmacros_tikz_draw:f { \tl_use:N \l__chemmacros_newman_tikz_ring_tl } - (0,0) -- ++ + (0pt,0pt) -- ++ ( 30 * \fp_to_dim:N \l__chemmacros_newman_x_fp , 30 * \fp_to_dim:N \l__chemmacros_newman_y_fp @@ -3211,7 +3217,7 @@ { \chemmacros_tikz_shade:f { ball~color = \l__chemmacros_orbital_s_phase_color_tl } - (0,0) circle (\l__chemmacros_orbital_s_scale_tl * .6em) ; + (0pt,0pt) circle (\l__chemmacros_orbital_s_scale_tl * .6em) ; } } @@ -3278,7 +3284,7 @@ draw = \l__chemmacros_orbital_p_pphase_color_tl , ball~color = \l__chemmacros_orbital_p_pphase_color_tl } - (0,0) .. controls ++ + (0pt,0pt) .. controls ++ ( - \l__chemmacros_orbital_p_scale_tl * 2em , \l__chemmacros_orbital_p_scale_tl * 2em @@ -3288,7 +3294,7 @@ \l__chemmacros_orbital_p_scale_tl * 2em , \l__chemmacros_orbital_p_scale_tl * 2em ) - .. (0,0); + .. (0pt,0pt); \bool_if:NF \l__chemmacros_orbital_p_half_bool { \chemmacros_tikz_shadedraw:f @@ -3296,7 +3302,7 @@ draw = \l__chemmacros_orbital_p_mphase_color_tl , ball~color = \l__chemmacros_orbital_p_mphase_color_tl } - (0,0) .. controls ++ + (0pt,0pt) .. controls ++ ( - \l__chemmacros_orbital_p_scale_tl * 2em , - \l__chemmacros_orbital_p_scale_tl * 2em @@ -3306,7 +3312,7 @@ \l__chemmacros_orbital_p_scale_tl * 2em , - \l__chemmacros_orbital_p_scale_tl * 2em ) - .. (0,0); + .. (0pt,0pt); } } } @@ -3372,7 +3378,7 @@ draw = \l__chemmacros_orbital_sp_pphase_color_tl , ball~color = \l__chemmacros_orbital_sp_pphase_color_tl } - (0,0) .. controls ++ + (0pt,0pt) .. controls ++ ( - \l__chemmacros_orbital_sp_scale_tl * 2em , \l__chemmacros_orbital_sp_scale_tl * 2em @@ -3382,13 +3388,13 @@ \l__chemmacros_orbital_sp_scale_tl * 2em , \l__chemmacros_orbital_sp_scale_tl * 2em ) - .. (0,0); + .. (0pt,0pt); \chemmacros_tikz_shadedraw:f { draw = \l__chemmacros_orbital_sp_mphase_color_tl , ball~color = \l__chemmacros_orbital_sp_mphase_color_tl } - (0,0) .. controls ++ + (0pt,0pt) .. controls ++ ( - \l__chemmacros_orbital_sp_scale_tl * .6em , - \l__chemmacros_orbital_sp_scale_tl * .6em @@ -3398,7 +3404,7 @@ \l__chemmacros_orbital_sp_scale_tl * .6em , - \l__chemmacros_orbital_sp_scale_tl * .6em ) - .. (0,0); + .. (0pt,0pt); } } @@ -3463,7 +3469,7 @@ draw = \l__chemmacros_orbital_sptwo_pphase_color_tl , ball~color = \l__chemmacros_orbital_sptwo_pphase_color_tl } - (0,0) .. controls ++ + (0pt,0pt) .. controls ++ ( - \l__chemmacros_orbital_sptwo_scale_tl * 2em , \l__chemmacros_orbital_sptwo_scale_tl * 2em @@ -3473,13 +3479,13 @@ \l__chemmacros_orbital_sptwo_scale_tl * 2em , \l__chemmacros_orbital_sptwo_scale_tl * 2em ) - .. (0,0); + .. (0pt,0pt); \chemmacros_tikz_shadedraw:f { draw = \l__chemmacros_orbital_sptwo_mphase_color_tl , ball~color = \l__chemmacros_orbital_sptwo_mphase_color_tl } - (0,0) .. controls ++ + (0pt,0pt) .. controls ++ ( - \l__chemmacros_orbital_sptwo_scale_tl * .8em , - \l__chemmacros_orbital_sptwo_scale_tl * .8em @@ -3489,7 +3495,7 @@ \l__chemmacros_orbital_sptwo_scale_tl * .8em , - \l__chemmacros_orbital_sptwo_scale_tl * .8em ) - .. (0,0); + .. (0pt,0pt); } } @@ -3554,7 +3560,7 @@ draw = \l__chemmacros_orbital_spthree_pphase_color_tl , ball~color = \l__chemmacros_orbital_spthree_pphase_color_tl } - (0,0) .. controls ++ + (0pt,0pt) .. controls ++ ( - \l__chemmacros_orbital_spthree_scale_tl * 2em , \l__chemmacros_orbital_spthree_scale_tl * 2em @@ -3564,13 +3570,13 @@ \l__chemmacros_orbital_spthree_scale_tl * 2em , \l__chemmacros_orbital_spthree_scale_tl * 2em ) - .. (0,0); + .. (0pt,0pt); \chemmacros_tikz_shadedraw:f { draw = \l__chemmacros_orbital_spthree_mphase_color_tl , ball~color = \l__chemmacros_orbital_spthree_mphase_color_tl } - (0,0) .. controls ++ + (0pt,0pt) .. controls ++ ( - \l__chemmacros_orbital_spthree_scale_tl * 1em , - \l__chemmacros_orbital_spthree_scale_tl * 1em @@ -3580,7 +3586,7 @@ \l__chemmacros_orbital_spthree_scale_tl * 1em , - \l__chemmacros_orbital_spthree_scale_tl * 1em ) - .. (0,0); + .. (0pt,0pt); } } @@ -4006,9 +4012,17 @@ Version history used together with `hyperref' - new option `reaction/list-heading' - option `charges/append' deprecated - +2013/08/07 - version 4.0a - extra pair of braces in definition of + \standardstate + - added missing \exp_not:n to the definitions of + \chemmacros_declare_phase:Nn and kin +2013/08/24 - version 4.1 - changed `0' values in TikZ coordinates into `0pt' + see http://tex.stackexchange.com/q/128792/5049 and + http://tex.stackexchange.com/q/118467/5049 for + reference % --------------------------------------------------------------------------- % -% TODO: fuer version 4 +% TODO: - add d-orbitals - make electron movement arrow tips (`el', `left el' and `right el') public + diff --git a/Master/texmf-dist/tex/latex/chemmacros/language/ghsystem_english.def b/Master/texmf-dist/tex/latex/chemmacros/language/ghsystem_english.def index 4dc71bee897..85bf82778af 100644 --- a/Master/texmf-dist/tex/latex/chemmacros/language/ghsystem_english.def +++ b/Master/texmf-dist/tex/latex/chemmacros/language/ghsystem_english.def @@ -241,7 +241,7 @@ { May~ cause~ damage \bool_if:NF \l__ghsystem_organs_bool { ~to~ organs } - \ghsystem_organs:\c_space_rl + \ghsystem_organs:\c_space_tl through~ prolonged~ or~ repeated~ exposure. \ghsystem_exposure: } |