summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-02-11 00:49:37 +0000
committerKarl Berry <karl@freefriends.org>2012-02-11 00:49:37 +0000
commit48ea98193ab70b9d4d1e5fb2acddd70a1ff3d5ae (patch)
tree292cdab18d35cc42df39f2d819c5b0751c97be39 /Master/texmf-dist/tex/latex/chemmacros/chemformula.sty
parent3562f80e5794c062e8d3b071c4305e06688cafcb (diff)
chemmacros (10feb12)
git-svn-id: svn://tug.org/texlive/trunk@25352 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemmacros/chemformula.sty')
-rw-r--r--Master/texmf-dist/tex/latex/chemmacros/chemformula.sty226
1 files changed, 179 insertions, 47 deletions
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty b/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty
index 3ba0ba784ac..b5e74df2f90 100644
--- a/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty
+++ b/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty
@@ -5,9 +5,9 @@
% - macros and commands for chemists - %
% --------------------------------------------------------------------------- %
% - Clemens Niederberger - %
-% - 2012/02/05 - %
+% - 2012/02/10 - %
% --------------------------------------------------------------------------- %
-% - http://www.mychemistry.eu/ - %
+% - https://bitbucket.org/cgnieder/chemmacros/ - %
% - contact@mychemistry.eu - %
% --------------------------------------------------------------------------- %
% - If you have any ideas, questions, suggestions or bugs to report, please - %
@@ -28,7 +28,7 @@
% - The Current Maintainer of this work is Clemens Niederberger. - %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{ expl3 }
-\ProvidesExplPackage {chemformula} {2012/02/05} {3.0c} {typeset chemical compounds and reactions}
+\ProvidesExplPackage {chemformula} {2012/02/10} {3.0d} {typeset chemical compounds and reactions}
%-----------------------------------------------------------------------------%
% WARNING AND ERROR MESSAGES
@@ -113,6 +113,7 @@
\textperiodcentered
\skip_horizontal:N \l_chemformula_cdot_space_dim
}
+\cs_new_eq:NN \chemformula_star_adduct: \chemformula_adduct:
%-----------------------------------------------------------------------------%
% ARROW DEFINITION
@@ -275,8 +276,20 @@
coordinate (chemformula_arrow_start) (0,0)
++ (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++
( \dim_use:N \l_chemformula_arrow_length_dim , 0)
- node[pos=.5,above=\l_chemformula_arrow_label_offset_dim,font=\l_chemformula_arrow_label_style_tl,butt~cap-butt~cap] { #1 }
- node[pos=.5,below=\l_chemformula_arrow_label_offset_dim,font=\l_chemformula_arrow_label_style_tl,butt~cap-butt~cap] { #2 }
+ node
+ [
+ pos=.5,
+ above=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #1 }
+ node
+ [
+ pos=.5,
+ below=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #2 }
}
\chemformula_draw:nn {}
{
@@ -297,8 +310,20 @@
coordinate (chemformula_arrow_start) (0,0)
++ (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++
( \dim_use:N \l_chemformula_arrow_length_dim , 0)
- node[pos=.5,above=\l_chemformula_arrow_label_offset_dim,font=\l_chemformula_arrow_label_style_tl,butt~cap-butt~cap] { #1 }
- node[pos=.5,below=\l_chemformula_arrow_label_offset_dim,font=\l_chemformula_arrow_label_style_tl,butt~cap-butt~cap] { #2 }
+ node
+ [
+ pos=.5,
+ above=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #1 }
+ node
+ [
+ pos=.5,
+ below=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #2 }
}
\chemformula_draw:nn {}
{
@@ -319,8 +344,20 @@
coordinate (chemformula_arrow_start) (0,0)
++ (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++
( \dim_use:N \l_chemformula_arrow_length_dim , 0)
- node[pos=.5,above=\l_chemformula_arrow_label_offset_dim,font=\l_chemformula_arrow_label_style_tl,butt~cap-butt~cap] { #1 }
- node[pos=.5,below=\l_chemformula_arrow_label_offset_dim,font=\l_chemformula_arrow_label_style_tl,butt~cap-butt~cap] { #2 }
+ node
+ [
+ pos=.5,
+ above=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #1 }
+ node
+ [
+ pos=.5,
+ below=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #2 }
}
\chemformula_draw:nn {}
{
@@ -341,14 +378,26 @@
coordinate (chemformula_arrow_start) (0,0)
++ (\l_chemformula_compound_sep_dim,.429em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++
( \dim_use:N \l_chemformula_arrow_length_dim , 0)
- node[pos=.5,above=\l_chemformula_arrow_label_offset_dim,font=\l_chemformula_arrow_label_style_tl,butt~cap-butt~cap] { #1 }
+ node
+ [
+ pos=.5,
+ above=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #1 }
}
\chemformula_draw:xn { left~\l_chemformula_arrow_head_tl- , \l_chemformula_arrow_style_tl }
{
(chemformula_arrow_start) ++
(\l_chemformula_compound_sep_dim,.2574em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++
( \dim_use:N \l_chemformula_arrow_length_dim , 0)
- node[pos=.5,below=\l_chemformula_arrow_label_offset_dim,font=\l_chemformula_arrow_label_style_tl,butt~cap-butt~cap] { #2 }
+ node
+ [
+ pos=.5,
+ below=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #2 }
}
\chemformula_draw:nn {}
{
@@ -369,14 +418,26 @@
coordinate (chemformula_arrow_start) (0,0)
++ (\l_chemformula_compound_sep_dim,.429em) ++ (0,\dim_use:N \l_chemformula_arrow_yshift_dim) -- ++
( \dim_use:N \l_chemformula_arrow_length_dim , 0)
- node[pos=.5,above=\l_chemformula_arrow_label_offset_dim,font=\l_chemformula_arrow_label_style_tl,butt~cap-butt~cap] { #1 }
+ node
+ [
+ pos=.5,
+ above=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #1 }
}
\chemformula_draw:xn { left~\l_chemformula_arrow_head_tl- , \l_chemformula_arrow_style_tl }
{
(chemformula_arrow_start) ++
(\l_chemformula_compound_sep_dim + \l_chemformula_arrow_shortage_dim,.2574em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++
( \dim_use:N \l_chemformula_arrow_length_dim -2*\l_chemformula_arrow_shortage_dim , 0)
- node[pos=.5,below=\l_chemformula_arrow_label_offset_dim,font=\l_chemformula_arrow_label_style_tl,butt~cap-butt~cap] { #2 }
+ node
+ [
+ pos=.5,
+ below=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #2 }
}
\chemformula_draw:nn {}
{
@@ -397,13 +458,25 @@
coordinate (chemformula_arrow_start) (0,0)
++ (\l_chemformula_compound_sep_dim + \l_chemformula_arrow_shortage_dim,.429em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++
( \dim_use:N \l_chemformula_arrow_length_dim - 2*\l_chemformula_arrow_shortage_dim , 0)
- node[pos=.5,above=\l_chemformula_arrow_label_offset_dim,font=\l_chemformula_arrow_label_style_tl,butt~cap-butt~cap] { #1 }
+ node
+ [
+ pos=.5,
+ above=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #1 }
}
\chemformula_draw:xn { left~\l_chemformula_arrow_head_tl- , \l_chemformula_arrow_style_tl }
{
(chemformula_arrow_start) ++ (\l_chemformula_compound_sep_dim,.2574em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++
( \dim_use:N \l_chemformula_arrow_length_dim , 0)
- node[pos=.5,below=\l_chemformula_arrow_label_offset_dim,font=\l_chemformula_arrow_label_style_tl,butt~cap-butt~cap] { #2 }
+ node
+ [
+ pos=.5,
+ below=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #2 }
}
\chemformula_draw:nn {}
{
@@ -413,6 +486,45 @@
}
}
+% <>
+\NewDocumentCommand \chemformula_arrow_both:w { O{}O{} }
+ {
+ \chemformula_determine_arrow_length:nn { #1 } { #2 }
+ \chemformula_tikz:nn { inner~sep=0, baseline=(chemformula_arrow_start.base) }
+ {
+ \chemformula_draw:xn { -\l_chemformula_arrow_head_tl , \l_chemformula_arrow_style_tl }
+ {
+ coordinate (chemformula_arrow_start) (0,0)
+ ++ (\l_chemformula_compound_sep_dim,.441em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++
+ ( \dim_use:N \l_chemformula_arrow_length_dim , 0)
+ node
+ [
+ pos=.5,
+ above=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #1 }
+ }
+ \chemformula_draw:xn { \l_chemformula_arrow_head_tl- , \l_chemformula_arrow_style_tl }
+ {
+ (chemformula_arrow_start) ++
+ (\l_chemformula_compound_sep_dim,.2454em) ++ (0,\l_chemformula_arrow_yshift_dim) -- ++
+ ( \dim_use:N \l_chemformula_arrow_length_dim , 0)
+ node
+ [
+ pos=.5,
+ below=\l_chemformula_arrow_label_offset_dim,
+ font=\l_chemformula_arrow_label_style_tl,
+ butt~cap-butt~cap
+ ] { #2 }
+ }
+ \chemformula_draw:nn {}
+ {
+ (\l_chemformula_compound_sep_dim,.3432em) ++ (0,\l_chemformula_arrow_yshift_dim) ++
+ ( \l_chemformula_compound_sep_dim + \dim_use:N \l_chemformula_arrow_length_dim , 0)
+ }
+ }
+ }
%-----------------------------------------------------------------------------%
% arrow customization
\keys_define:nn { chemmacros / chemformula }
@@ -432,6 +544,7 @@
\NewDocumentCommand \chemformula_ch_aux_iii:w { > { \SplitList { ~ } } m }
{
\group_begin:
+ \bool_set_true:N \l_chemformula_inside_ch_bool
\tl_if_blank:oF { \g_chemformula_options_tl }
{ \keys_set:no { chemmacros / chemformula } { \g_chemformula_options_tl } }
\tl_map_function:nN { #1 } \chemformula_input:n
@@ -447,6 +560,8 @@
\cs_new:Nn \chemformula_ch:nn
{
\group_align_safe_begin:
+ \cs_set:Npn \xspace {}
+ \leavevmode
\IfNoValueTF { #1 }
{ \tl_gclear:N \g_chemformula_options_tl }
{ \tl_gset:Nn \g_chemformula_options_tl { #1 } }
@@ -510,6 +625,8 @@
{ \tl_replace_all:Nnn \l_tmpa_tl { <=>> } { \chemformula_arrow_equilibrium_right:w } }
\tl_if_in:onT { \l_tmpa_tl } { <=> }
{ \tl_replace_all:Nnn \l_tmpa_tl { <=> } { \chemformula_arrow_equilibrium:w } }
+ \tl_if_in:onT { \l_tmpa_tl } { <> }
+ { \tl_replace_all:Nnn \l_tmpa_tl { <> } { \chemformula_arrow_both:w } }
\tl_set_eq:NN \l_chemformula_output_tl \l_tmpa_tl
}
\cs_generate_variant:Nn \chemformula_generate_arrows:n { N }
@@ -585,6 +702,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% parsing input
% booleans:
+\bool_new:N \l_chemformula_inside_ch_bool
\bool_new:N \l_chemformula_stoich_bool
\bool_new:N \l_chemformula_is_plus_bool
\bool_new:N \l_chemformula_is_up_bool
@@ -599,6 +717,7 @@
\bool_new:N \l_chemformula_charge_style_math_bool
\bool_new:N \l_chemformula_sub_bool
\bool_new:N \l_chemformula_sup_bool
+\bool_new:N \l_chemformula_first_is_sup_bool
\bool_new:N \l_chemformula_xfrac_bool
\bool_new:N \l_chemformula_nicefrac_bool
\bool_new:N \l_chemformula_mathfrac_bool
@@ -642,7 +761,7 @@
\dim_new:N \l_chemformula_cdot_space_dim
\dim_set:Nn \l_chemformula_cdot_space_dim { .1333em }
\dim_new:N \l_chemformula_charge_shift_dim
- \dim_set:Nn \l_chemformula_charge_shift_dim { .3ex }
+ \dim_set:Nn \l_chemformula_charge_shift_dim { 1ex }
\dim_new:N \l_chemformula_subscript_shift_default_dim
\dim_set:Nn \l_chemformula_subscript_shift_default_dim { -.6ex }
\dim_new:N \l_chemformula_subscript_shift_dim
@@ -654,6 +773,7 @@
\dim_zero:N \l_chemformula_subscript_dim
\dim_new:N \l_chemformula_supscript_dim
\dim_zero:N \l_chemformula_supscript_dim
+\dim_new:N \l_chemformula_subscript_compare_dim
\dim_new:N \l_chemformula_bond_dim
\hbox_set:Nn \l_tmpa_box { \textendash }
\dim_set:Nn \l_chemformula_bond_dim { \box_wd:N \l_tmpa_box }
@@ -675,7 +795,7 @@
\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_adduct: }
+\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: }
@@ -789,6 +909,7 @@
\tl_replace_all:Nnn \l_tmpc_tl { \chemformula_single_bond: } { \chemformula_minus: }
\tl_replace_all:Nnn \l_tmpc_tl { \chemformula_triple_bond: } {\chemformula_plus: }
\tl_replace_all:Nnn \l_tmpc_tl { \chemformula_adduct: } { . }
+ \tl_replace_all:Nnn \l_tmpc_tl { \chemformula_star_adduct: } { * }
% measure width and save it
\hbox_set:Nn \l_tmpa_box
{
@@ -802,13 +923,18 @@
{ \chemformula_number_style:n { \l_tmpc_tl } }$
}
\dim_set:Nn \l_chemformula_subscript_dim { -\box_wd:N \l_tmpa_box }
+ \prop_get:NnNTF \l_chemformula_charge_prop { #1 } \l_tmpa_tl
+ { \exp_args:NNo \hbox_set:Nn \l_tmpb_box { $ ^ { \chemformula_charge_style:n { \l_tmpa_tl } } $ } }
+ { \exp_args:NNo \hbox_set:Nn \l_tmpb_box { $ ^ { \chemformula_charge_style:n { \l_tmpc_tl } } $ } }
+ \dim_set:Nn \l_chemformula_subscript_compare_dim { -\box_wd:N \l_tmpb_box }
\box_clear:N \l_tmpa_box
+ \box_clear:N \l_tmpb_box
\bool_if:NT \l_chemformula_sup_bool
{
\chemformula_sub_or_supscript_skip:
\bool_if:NT \l_chemformula_charge_shift_bool
{
- \skip_horizontal:n { \l_chemformula_charge_shift_dim +1pt }
+ \skip_horizontal:N \l_chemformula_charge_shift_dim
\bool_set_false:N \l_chemformula_charge_shift_bool
}
\dim_zero:N \l_chemformula_supscript_dim
@@ -845,6 +971,7 @@
\tl_replace_all:Nnn \l_tmpc_tl { \chemformula_triple_bond: } { \chemformula_plus: }
\tl_replace_all:Nnn \l_tmpc_tl { + } { \chemformula_plus: }
\tl_replace_all:Nnn \l_tmpc_tl { \chemformula_adduct: } { \chemformula_radical: }
+ \tl_replace_all:Nnn \l_tmpc_tl { \chemformula_star_adduct: } { * }
\tl_replace_all:Nnn \l_tmpc_tl { . } { \chemformula_radical: }
% measure width and save it
\prop_get:NnNTF \l_chemformula_charge_prop { #1 } \l_tmpa_tl
@@ -856,7 +983,7 @@
\bool_if:NT \l_chemformula_sub_bool
{
\chemformula_sub_or_supscript_skip:
- \skip_horizontal:N \l_chemformula_charge_shift_dim
+ \skip_horizontal:n \l_chemformula_charge_shift_dim
\bool_set_true:N \l_chemformula_charge_shift_bool
\dim_zero:N \l_chemformula_subscript_dim
}
@@ -876,16 +1003,27 @@
\cs_new:Npn \chemformula_sub_or_supscript_skip:
{
- \dim_compare:nTF
+ \bool_if:NTF \l_chemformula_first_is_sup_bool
{
- \dim_abs:n { \l_chemformula_subscript_dim }
- <=
- \dim_abs:n { \l_chemformula_supscript_dim }
+ % when compound starts with a superscript only shift back
+ % by the width of the subscript to align them left
+ \bool_set_false:N \l_chemformula_first_is_sup_bool
+ \skip_horizontal:N \l_chemformula_subscript_compare_dim
+ \bool_set_false:N \l_chemformula_sup_bool
+ \bool_set_false:N \l_chemformula_sub_bool
+ }
+ {
+ \dim_compare:nTF
+ {
+ \dim_abs:n { \l_chemformula_subscript_compare_dim }
+ <=
+ \dim_abs:n { \l_chemformula_supscript_dim }
+ }
+ { \skip_horizontal:N \l_chemformula_subscript_compare_dim }
+ { \skip_horizontal:N \l_chemformula_supscript_dim }
+ \bool_set_false:N \l_chemformula_sup_bool
+ \bool_set_false:N \l_chemformula_sub_bool
}
- { \skip_horizontal:N \l_chemformula_subscript_dim }
- { \skip_horizontal:N \l_chemformula_supscript_dim }
- \bool_set_false:N \l_chemformula_sup_bool
- \bool_set_false:N \l_chemformula_sub_bool
}
% handle sub- in superscripts and vice versa
@@ -1084,7 +1222,7 @@
\tl_clear:N \l_chemformula_stoich_tl
}
}
-\cs_generate_variant:Nn \chemformula_input_cmpd:nN { oN }
+\cs_generate_variant:Nn \chemformula_input_cmpd:nN { oN , fN , xN }
\cs_new:Nn \chemformula_font_inner:
{
@@ -1127,6 +1265,9 @@
\char_set_catcode_letter:N \\
}
{ #1 }
+ % let's see if the compound starts with a superscript:
+ \exp_args:Nx \tl_if_in:nnT { \tl_head:V \l_tmpa_tl } { ^ }
+ { \bool_set_true:N \l_chemformula_first_is_sup_bool }
\tl_if_in:VnT \l_tmpa_tl { ^ }
{ \tl_replace_all:Nnn \l_tmpa_tl { ^ } { \chemformula_chief_supscript:n } }
\tl_if_in:VnT \l_tmpa_tl { _ }
@@ -1174,25 +1315,9 @@
{ \chemformula_font_inner: ##1 }
}
\cs_set:Npn \chemmacros_xspace: {}
- \tl_set:Nn \l_tmpa_tl { #1 }
- \exp_args:NNo \tl_replace_all:Nnn \l_tmpa_tl { \l_chemformula_aq_tl } { _{(aq)} }
- \bool_if:NTF \l_chemmacros_german_bool
- { \exp_args:NNo \tl_replace_all:Nnn \l_tmpa_tl { \l_chemformula_sld_tl } { _{(f)} } }
- { \exp_args:NNo \tl_replace_all:Nnn \l_tmpa_tl { \l_chemformula_sld_tl } { _{(s)} } }
- \bool_if:NTF \l_chemmacros_german_bool
- { \exp_args:NNo \tl_replace_all:Nnn \l_tmpa_tl { \l_chemformula_lqd_tl } { _{(f\/l)} } }
- { \exp_args:NNo \tl_replace_all:Nnn \l_tmpa_tl { \l_chemformula_lqd_tl } { _{(l)} } }
- \exp_args:NNo \tl_replace_all:Nnn \l_tmpa_tl { \l_chemformula_gas_tl } { _{(g)} }
- \tl_set_eq:NN \l_chemformula_tmpa_tl \l_tmpa_tl
}
\cs_generate_variant:Nn \chemformula_clean_chem_macros:n { o }
-\tl_new:N \l_chemformula_aq_tl
-\tl_set_rescan:Nnn \l_chemformula_aq_tl { \char_set_catcode_letter:N \\ } { \aq }
-\tl_set_rescan:Nnn \l_chemformula_sld_tl { \char_set_catcode_letter:N \\ } { \sld }
-\tl_set_rescan:Nnn \l_chemformula_lqd_tl { \char_set_catcode_letter:N \\ } { \lqd }
-\tl_set_rescan:Nnn \l_chemformula_gas_tl { \char_set_catcode_letter:N \\ } { \gas }
-
%-----------------------------------------------------------------------------%
% input "and" sign
\cs_new:Nn \chemformula_input_plus:n
@@ -1277,7 +1402,7 @@
\cs_new:Npn \chemformula_read_escape_double:w "#1" \q_nil
{
\tl_set_rescan:Nnn \l_tmpa_tl
- { \ExplSyntaxOn \char_set_catcode_other:N \: }
+ { \ExplSyntaxNamesOn \char_set_catcode_other:N \: }
{ #1 }
\tl_replace_all:Nnn \l_tmpa_tl { \_ } { chemformulaplaceholder }
\tl_replace_all:Nnn \l_tmpa_tl { _ } { \sb }
@@ -1353,7 +1478,7 @@
{
\tl_set_rescan:Nnn \l_tmpa_tl
{
- \ExplSyntaxOn \char_set_catcode_letter:N \{
+ \ExplSyntaxNamesOn \char_set_catcode_letter:N \{
\char_set_catcode_letter:N \}
}
{ \mbox { \( #1 \) } }
@@ -1393,7 +1518,7 @@
\keys_define:nn { chemmacros / chemformula }
{
charge-hshift .dim_set:N = \l_chemformula_charge_shift_dim ,
- charge-hshift .default:n = .3ex ,
+ charge-hshift .default:n = 1ex ,
charge-style .choice: ,
charge-style / text .code:n =
\bool_set_false:N \l_chemformula_charge_style_math_bool ,
@@ -1478,6 +1603,13 @@ VERSION HISTORY
renamed formula => chemformula
2012/02/02 - version 3.0b - updated documentation
2012/02/05 - version 3.0c - renamed pictogram files
+2012/02/10 - version 3.0d - \xspace disabled inside \ch{}
+ - bugfix: \ch{_{123}^{23}U} now compiles (\leavevmode
+ added)
+ - bugfix: right shift for the super- und subscripts
+ - bugfix: escaped text recognizes space by ~ again
+ - * in superscript now gives excited state
+ - new arrow type <>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TODO