summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-11-05 01:11:09 +0000
committerKarl Berry <karl@freefriends.org>2013-11-05 01:11:09 +0000
commite622b0b85ef0c5d697b6a571ed79b6e6501f2f33 (patch)
tree9120227a24e4ac3ce174ef91ff9c467511032d4a /Master/texmf-dist/tex/latex
parent3c765a85506e5e370e6f349eb8fc66141a9f6c36 (diff)
chemmacros (4nov13)
git-svn-id: svn://tug.org/texlive/trunk@32073 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/chemmacros/chemformula.sty93
-rw-r--r--Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty15
2 files changed, 78 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty b/Master/texmf-dist/tex/latex/chemmacros/chemformula.sty
index 38408cde11b..5a284390463 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.2}
-\def\chemformula@date{2013/10/24}
+\def\chemformula@version{4.2a}
+\def\chemformula@date{2013/11/04}
\ProvidesExplPackage
{chemformula}
@@ -919,7 +919,7 @@
\group_begin:
\seq_set_split:Nnn \l__chemformula_input_seq { ~ } { #1 }
\cs_set_eq:NN \xspace \scan_stop:
- % the next two necessary any more but shouldn't do harm, too:
+ % the next two aren't necessary any more but shouldn't do harm, too:
\cs_set_nopar:Npn \[ { [ }
\cs_set_nopar:Npn \] { ] }
\bool_set_true:N \l_chemformula_inside_ch_bool
@@ -932,9 +932,7 @@
\seq_map_function:NN
\l__chemformula_input_seq
\chemformula_input:n
- \tl_set_rescan:NnV \l__chemformula_input_tl
- { \ExplSyntaxOn \makeatletter }
- \l__chemformula_input_tl
+ \__chemformula_prepare_output:N \l__chemformula_input_tl
\chemformula_write:V \l__chemformula_input_tl
\group_end:
}
@@ -1037,8 +1035,13 @@
{
\group_begin:
\keys_set:nn { chemmacros / chemformula } { #1 }
-
- \chemformula_input_cmpd:nN { #2 } \l__chemformula_compound_tl
+ \__chemformula_sanitize:Nn
+ \l__chemformula_chemformula_tmpa_tl
+ { #2 }
+ \chemformula_input_cmpd:VN
+ \l__chemformula_chemformula_tmpa_tl
+ \l__chemformula_compound_tl
+ \__chemformula_prepare_output:N \l__chemformula_compound_tl
\chemformula_write:V \l__chemformula_compound_tl
\group_end:
}
@@ -1081,20 +1084,23 @@
\cs_new:Npn \chemformula_chwritebelow:nn #1#2
{
- \(
- \underset
- {
- \bool_if:NF \l__chemformula_name_width_bool
- {
- \chemformula_dim_to_width:Nn \l__chemformula_name_dim
- { \l__chemformula_name_format_tl #1 }
- }
- \parbox
- { \dim_use:N \l__chemformula_name_dim }
- { \l__chemformula_name_format_tl #1 }
- }
- { \text { \strut #2 } }
- \)
+% \group_begin:
+% \__chemformula_reset:Nn \l__chemformula_tmpa_tl { #1 }
+ \(
+ \underset
+ {
+ \bool_if:NF \l__chemformula_name_width_bool
+ {
+ \chemformula_dim_to_width:Nn \l__chemformula_name_dim
+ { \l__chemformula_name_format_tl #1 }
+ }
+ \parbox
+ { \dim_use:N \l__chemformula_name_dim }
+ { \l__chemformula_name_format_tl #1 }
+ }
+ { \text { \strut #2 } }
+ \)
+% \group_end:
}
\cs_new_protected:Npn \__chemformula_generate_name:Nn #1#2
@@ -1237,7 +1243,8 @@
\cs_new_protected:Npn \__chemformula_bond_draw:n #1
{
- \tl_set_rescan:Nnn \l__chemformula_tmpa_tl {} { #1 }
+ \__chemformula_reset:Nn \l__chemformula_tmpa_tl { #1 }
+ % \tl_set_rescan:Nnn \l__chemformula_tmpa_tl {} { #1 }
\prop_get:NV \l__chemformula_bonds_prop
\l__chemformula_tmpa_tl
}
@@ -1674,7 +1681,8 @@
% set options for next compound:
\cs_new_protected:Npn \chemformula_input_options:n #1
{
- \makeatother
+ % \makeatother
+ \char_set_catcode_other:N \@
\tl_set_rescan:Nnn \l__chemformula_tmpa_tl
{ \char_set_catcode_letter:N \@ }
{ #1 }
@@ -1683,7 +1691,8 @@
\bool_set_true:N \l__chemformula_options_bool
\bool_set_true:N \l__chemformula_is_option_bool
\tl_remove_all:Nn \l__chemformula_tmpa_tl { @ }
- \exp_last_unbraced:Nno \tl_set:Nn \l__chemformula_internal_options_tl
+ \exp_last_unbraced:Nno
+ \tl_set:Nn \l__chemformula_internal_options_tl
{ \l__chemformula_tmpa_tl }
}
{ \bool_set_false:N \l__chemformula_is_option_bool }
@@ -1913,6 +1922,17 @@
\cs_new_protected:Npn \__chemformula_sanitize:Nn #1#2
{
+ \cs_gset_protected:Npx \__chemformula_restore:
+ {
+ \char_set_catcode:nn { 95 } { \char_value_catcode:n { 95 } }% _
+ \char_set_catcode:nn { 58 } { \char_value_catcode:n { 58 } }% :
+ \char_set_catcode:nn { 94 } { \char_value_catcode:n { 94 } }% ^
+ \char_set_catcode:nn { 123 } { \char_value_catcode:n { 123 } }% {
+ \char_set_catcode:nn { 125 } { \char_value_catcode:n { 125 } }% }
+ \char_set_catcode:nn { 35 } { \char_value_catcode:n { 35 } }% #
+ \char_set_catcode:nn { 33 } { \char_value_catcode:n { 33 } }% !
+ \char_set_catcode:nn { 34 } { \char_value_catcode:n { 34 } }% "
+ }
\tl_set_rescan:Nnn #1
{
% expl3 catcodes:
@@ -1936,6 +1956,21 @@
}
\cs_generate_variant:Nn \__chemformula_sanitize:Nn { NV }
+\cs_new_protected:Npn \__chemformula_prepare_output:N #1
+ {
+ \tl_set_rescan:NnV #1
+ {
+ \__chemformula_restore:
+ \ExplSyntaxOn
+ \makeatletter
+ }
+ #1
+ }
+
+\cs_new_protected:Npn \__chemformula_reset:Nn #1#2
+ { \tl_set_rescan:Nnn #1 { \__chemformula_restore: } { #2 } }
+\cs_generate_variant:Nn \__chemformula_reset:Nn { NV }
+
\cs_new_protected:Npn \__chemformula_handle_sub_and_superscripts:nN #1#2
{
\__chemformula_sanitize:Nn \l__chemformula_tmpa_tl { #1 }
@@ -2149,6 +2184,7 @@
{ _ } { \sb }
\tl_replace_all:Nnn \l__chemformula_tmpa_tl
{ chemformulaplaceholder } { \_ }
+ % \__chemformula_reset:NV \l__chemformula_tmpa_tl \l__chemformula_tmpa_tl
\tl_put_right:NV \l__chemformula_input_tl \l__chemformula_tmpa_tl
}
@@ -2207,6 +2243,7 @@
{ _ } { \sb }
\tl_replace_all:Nnn \l__chemformula_tmpa_tl
{ chemformulaplaceholder } { \_ }
+ % \__chemformula_reset:NV \l__chemformula_tmpa_tl \l__chemformula_tmpa_tl
\tl_put_right:NV \l__chemformula_input_tl \l__chemformula_tmpa_tl
\tl_put_right:Nn \l__chemformula_input_tl
{ \chemformula_skip_nobreak:N \l__chemformula_math_space_skip }
@@ -2691,10 +2728,14 @@ VERSION HISTORY
- fixed wrong setting of the TikZ bond style
- new option `arrow-style'
- new command \chlewis
+2013/11/04 - version 4.2a - bug fix in \chcpd,
+ - change sanitizing/restoring of category codes
% --------------------------------------------------------------------------
% TODO
- https://bitbucket.org/cgnieder/chemmacros/issue/23/
- Addukte: Zahlen nach * und . automatisch erkennen?
-- optionale Argumente von \\ nach außen
+- optionale Argumente von \\ nach außen
+- make escaped text/math /truely/ escaped, i.e., behave as if it's been input
+ /outside/ of \ch
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
index 2c0e7272907..a392fbe6d81 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.2a}
-\def\chemmacros@date{2013/10/31}
+\def\chemmacros@version{4.2b}
+\def\chemmacros@date{2013/11/04}
\ProvidesExplPackage
{chemmacros}
@@ -1089,9 +1089,15 @@
\DeclareChemIUPAC \E { \cip { E } }
\DeclareChemIUPAC \Z { \cip { Z } }
-% cis/trans & tert
-\DeclareChemIUPAC \cis { \textit{ cis } }
+% cis/trans
+\DeclareChemIUPAC \cis { \textit { cis } }
\DeclareChemIUPAC \trans { \textit { trans } }
+
+% fac/mer
+\DeclareChemIUPAC \fac { \textit { fac } }
+\DeclareChemIUPAC \mer { \textit { mer } }
+
+% tert
\DeclareChemIUPAC \tert { \textit { tert } }
% Fischer
@@ -4048,6 +4054,7 @@ Version history
\RenewChemState and improved both internal
definition and user interface
2013/10/31 - version 4.2a - bug bix in \hapto and \bridge
+2013/11/04 - version 4.2b - new IUPAC commands: \fac/\mer
% --------------------------------------------------------------------------- %
% TODO: