summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-01-05 23:15:38 +0000
committerKarl Berry <karl@freefriends.org>2013-01-05 23:15:38 +0000
commitb9d92c52672849ee2fd167c6675df004d6fa7125 (patch)
tree4f36277efbb2afaeacc766043f8b00ffd9fbaa4a /Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
parent487ae2279c7304e42a409a4c024234f7c9ddb0c7 (diff)
chemmacros (5jan13)
git-svn-id: svn://tug.org/texlive/trunk@28740 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty')
-rw-r--r--Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty1891
1 files changed, 947 insertions, 944 deletions
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
index 3c4c74bc299..26b5fae721b 100644
--- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
+++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.sty
@@ -12,7 +12,7 @@
% - If you have any ideas, questions, suggestions or bugs to report, please - %
% - feel free to contact me. - %
% --------------------------------------------------------------------------- %
-% - Copyright 2011-2012 Clemens Niederberger - %
+% - Copyright 2011-2013 Clemens Niederberger - %
% - - %
% - This work may be distributed and/or modified under the - %
% - conditions of the LaTeX Project Public License, either version 1.3 - %
@@ -29,8 +29,8 @@
\RequirePackage{ expl3 , xparse , l3keys2e , xfrac , siunitx }
\RequirePackage{ tikz , mathtools , environ , scrlfile , etoolbox , bm }
\usetikzlibrary{calc,arrows}
-\def\chemmacros@version{3.4a}
-\def\chemmacros@date{2012/10/03}
+\def\chemmacros@version{3.4b}
+\def\chemmacros@date{2013/01/04}
\ProvidesExplPackage
{chemmacros}
@@ -40,51 +40,51 @@
\@ifpackageloaded { chemformula } {} { \RequirePackage { chemformula } }
-\bool_new:N \l_chemmacros_version_one_bool
-\bool_new:N \l_chemmacros_xspace_bool
- \bool_set_true:N \l_chemmacros_xspace_bool
-\bool_new:N \l_chemmacros_bpchem_bool
-\bool_new:N \l_chemmacros_circled_bool
- \bool_set_true:N \l_chemmacros_circled_bool
-\bool_new:N \l_chemmacros_circled_formal_bool
- \bool_set_true:N \l_chemmacros_circled_formal_bool
-\bool_new:N \l_chemmacros_circled_chem_bool
- \bool_set_true:N \l_chemmacros_circled_chem_bool
-\bool_new:N \l_chemmacros_EZ_cool_bool
-\bool_new:N \l_chemmacros_Nu_mathspec_bool
-\bool_new:N \l_chemmacros_use_mhchem_bool
-\bool_new:N \l_chemmacros_chemstyle_bool
-\bool_new:N \l_chemmacros_hyperref_bool
-\bool_new:N \l_chemmacros_varioref_bool
-\bool_new:N \l_chemmacros_chemfig_bool
-\bool_new:N \l_chemmacros_ghsystem_bool
- \bool_set_true:N \l_chemmacros_ghsystem_bool
-\bool_new:N \l_chemmacros_iupac_restricted_bool
-\bool_new:N \l_chemmacros_iupac_strict_bool
-\bool_new:N \l_chemmacros_in_document_bool
+\bool_new:N \l__chemmacros_version_one_bool
+\bool_new:N \l__chemmacros_xspace_bool
+ \bool_set_true:N \l__chemmacros_xspace_bool
+\bool_new:N \l__chemmacros_bpchem_bool
+\bool_new:N \l__chemmacros_circled_bool
+ \bool_set_true:N \l__chemmacros_circled_bool
+\bool_new:N \l__chemmacros_circled_formal_bool
+ \bool_set_true:N \l__chemmacros_circled_formal_bool
+\bool_new:N \l__chemmacros_circled_chem_bool
+ \bool_set_true:N \l__chemmacros_circled_chem_bool
+\bool_new:N \l__chemmacros_EZ_cool_bool
+\bool_new:N \l__chemmacros_Nu_mathspec_bool
+\bool_new:N \l__chemmacros_use_mhchem_bool
+\bool_new:N \l__chemmacros_chemstyle_bool
+\bool_new:N \l__chemmacros_hyperref_bool
+\bool_new:N \l__chemmacros_varioref_bool
+\bool_new:N \l__chemmacros_chemfig_bool
+\bool_new:N \l__chemmacros_ghsystem_bool
+ \bool_set_true:N \l__chemmacros_ghsystem_bool
+\bool_new:N \l__chemmacros_iupac_restricted_bool
+\bool_new:N \l__chemmacros_iupac_strict_bool
+\bool_new:N \l__chemmacros_in_document_bool
\AtBeginDocument
{
- \bool_set_true:N \l_chemmacros_in_document_bool
+ \bool_set_true:N \l__chemmacros_in_document_bool
\@ifpackageloaded { chemstyle }
- { \bool_set_true:N \l_chemmacros_chemstyle_bool }
- { \bool_set_false:N \l_chemmacros_chemstyle_bool }
+ { \bool_set_true:N \l__chemmacros_chemstyle_bool }
+ { \bool_set_false:N \l__chemmacros_chemstyle_bool }
\@ifpackageloaded { varioref }
- { \bool_set_true:N \l_chemmacros_varioref_bool }
- { \bool_set_false:N \l_chemmacros_varioref_bool }
+ { \bool_set_true:N \l__chemmacros_varioref_bool }
+ { \bool_set_false:N \l__chemmacros_varioref_bool }
\@ifpackageloaded { hyperref }
- { \bool_set_true:N \l_chemmacros_hyperref_bool }
- { \bool_set_false:N \l_chemmacros_hyperref_bool }
+ { \bool_set_true:N \l__chemmacros_hyperref_bool }
+ { \bool_set_false:N \l__chemmacros_hyperref_bool }
\@ifpackageloaded { chemfig }
- { \bool_set_true:N \l_chemmacros_chemfig_bool }
- { \bool_set_false:N \l_chemmacros_chemfig_bool }
+ { \bool_set_true:N \l__chemmacros_chemfig_bool }
+ { \bool_set_false:N \l__chemmacros_chemfig_bool }
}
% --------------------------------------------------------------------------- %
% warning / error messages
\cs_new:Npn \chemmacros_msg:nnxx #1#2#3#4
{
- \bool_if:NTF \l_chemmacros_strict_bool
+ \bool_if:NTF \l__chemmacros_strict_bool
{ \msg_error:nnxx { #1 } { #2 } { #3 } { #4 } }
{ \msg_warning:nnxx { #1 } { #2 } { #3 } { #4 } }
}
@@ -265,9 +265,9 @@
% --------------------------------------------------------------------------- %
% scratch variables
-\tl_new:N \l_chemmacros_tmpa_tl
-\tl_new:N \l_chemmacros_tmpb_tl
-\int_new:N \l_chemmacros_tmpa_int
+\tl_new:N \l__chemmacros_tmpa_tl
+\tl_new:N \l__chemmacros_tmpb_tl
+\int_new:N \l__chemmacros_tmpa_int
% --------------------------------------------------------------------------- %
% package options
@@ -286,45 +286,45 @@
% version=1 => compatibility for documents set with v1.*
% xspace => add an \xspace after a whole bunch of macros
-\bool_new:N \l_chemmacros_strict_bool
-\bool_new:N \l_chemmacros_detect_bold_bool
-\bool_set_true:N \l_chemmacros_detect_bold_bool
+\bool_new:N \l__chemmacros_strict_bool
+\bool_new:N \l__chemmacros_detect_bold_bool
+\bool_set_true:N \l__chemmacros_detect_bold_bool
-\bool_new:N \l_chemmacros_use_upgreek_bool
-\bool_new:N \l_chemmacros_use_textgreek_bool
-\bool_new:N \l_chemmacros_option_upgreek_set_bool
+\bool_new:N \l__chemmacros_use_upgreek_bool
+\bool_new:N \l__chemmacros_use_textgreek_bool
+\bool_new:N \l__chemmacros_option_upgreek_set_bool
-\tl_new:N \l_chemmacros_language_tl
-\tl_set:Nn \l_chemmacros_language_tl { english }
-\tl_new:N \l_chemmacros_current_language_tl
-\tl_set:Nn \l_chemmacros_current_language_tl { english }
+\tl_new:N \l__chemmacros_language_tl
+\tl_set:Nn \l__chemmacros_language_tl { english }
+\tl_new:N \l__chemmacros_current_language_tl
+\tl_set:Nn \l__chemmacros_current_language_tl { english }
\cs_new:Npn \chemmacros_inner_font: {}
\keys_define:nn { chemmacros / option }
{
- bpchem .bool_set:N = \l_chemmacros_bpchem_bool ,
+ bpchem .bool_set:N = \l__chemmacros_bpchem_bool ,
bpchem .default:n = true ,
circletype .choice: ,
circletype / math .code:n =
- { \bool_set_false:N \l_chemmacros_circled_chem_bool } ,
+ { \bool_set_false:N \l__chemmacros_circled_chem_bool } ,
circletype / chem .code:n =
- { \bool_set_true:N \l_chemmacros_circled_chem_bool } ,
+ { \bool_set_true:N \l__chemmacros_circled_chem_bool } ,
circled .choice: ,
circled / none .code:n =
{
- \bool_set_false:N \l_chemmacros_circled_bool
- \bool_set_false:N \l_chemmacros_circled_formal_bool
+ \bool_set_false:N \l__chemmacros_circled_bool
+ \bool_set_false:N \l__chemmacros_circled_formal_bool
} ,
circled / formal .code:n =
{
- \bool_set_true:N \l_chemmacros_circled_bool
- \bool_set_true:N \l_chemmacros_circled_formal_bool
+ \bool_set_true:N \l__chemmacros_circled_bool
+ \bool_set_true:N \l__chemmacros_circled_formal_bool
} ,
circled / all .code:n =
{
- \bool_set_true:N \l_chemmacros_circled_bool
- \bool_set_false:N \l_chemmacros_circled_formal_bool
+ \bool_set_true:N \l__chemmacros_circled_bool
+ \bool_set_false:N \l__chemmacros_circled_formal_bool
} ,
circled .default:n = all ,
detect-bold .code:n =
@@ -333,33 +333,33 @@
EZ .code:n =
\chemmacros_msg:nnxx { chemmacros } { option-deprecated } { EZ } {} ,
german .code:n =
- \tl_set:Nn \l_chemmacros_language_tl { german } ,
+ \tl_set:Nn \l__chemmacros_language_tl { german } ,
ngerman .code:n =
- \tl_set:Nn \l_chemmacros_language_tl { ngerman } ,
- ghsystem .bool_set:N = \l_chemmacros_ghsystem_bool ,
+ \tl_set:Nn \l__chemmacros_language_tl { ngerman } ,
+ ghsystem .bool_set:N = \l__chemmacros_ghsystem_bool ,
ghsystem .default:n = true ,
iupac .choice: ,
iupac / restricted .code:n =
- \bool_set_true:N \l_chemmacros_iupac_restricted_bool
- \bool_set_false:N \l_chemmacros_iupac_strict_bool ,
+ \bool_set_true:N \l__chemmacros_iupac_restricted_bool
+ \bool_set_false:N \l__chemmacros_iupac_strict_bool ,
iupac / auto .code:n =
- \bool_set_false:N \l_chemmacros_iupac_restricted_bool
- \bool_set_false:N \l_chemmacros_iupac_strict_bool ,
+ \bool_set_false:N \l__chemmacros_iupac_restricted_bool
+ \bool_set_false:N \l__chemmacros_iupac_strict_bool ,
iupac / strict .code:n =
- \bool_set_false:N \l_chemmacros_iupac_restricted_bool
- \bool_set_true:N \l_chemmacros_iupac_strict_bool ,
- language .tl_set:N = \l_chemmacros_language_tl ,
+ \bool_set_false:N \l__chemmacros_iupac_restricted_bool
+ \bool_set_true:N \l__chemmacros_iupac_strict_bool ,
+ language .tl_set:N = \l__chemmacros_language_tl ,
method .choice: ,
method / chemformula .code:n =
- \bool_set_false:N \l_chemmacros_use_mhchem_bool ,
+ \bool_set_false:N \l__chemmacros_use_mhchem_bool ,
method / mhchem .code:n =
- \bool_set_true:N \l_chemmacros_use_mhchem_bool ,
+ \bool_set_true:N \l__chemmacros_use_mhchem_bool ,
Nu .choice: ,
Nu / mathspec .code:n =
- \bool_set_true:N \l_chemmacros_Nu_mathspec_bool ,
+ \bool_set_true:N \l__chemmacros_Nu_mathspec_bool ,
Nu / chemmacros .code:n =
- \bool_set_false:N \l_chemmacros_Nu_mathspec_bool ,
- strict .bool_set:N = \l_chemmacros_strict_bool ,
+ \bool_set_false:N \l__chemmacros_Nu_mathspec_bool ,
+ strict .bool_set:N = \l__chemmacros_strict_bool ,
strict .default:n = true ,
synchronize .choice: ,
synchronize / true .code:n =
@@ -368,17 +368,17 @@
synchronize .default:n = true ,
greek .choice: ,
greek / upgreek .code:n =
- \bool_set_true:N \l_chemmacros_use_upgreek_bool
- \bool_set_false:N \l_chemmacros_use_textgreek_bool
- \bool_set_true:N \l_chemmacros_option_upgreek_set_bool ,
+ \bool_set_true:N \l__chemmacros_use_upgreek_bool
+ \bool_set_false:N \l__chemmacros_use_textgreek_bool
+ \bool_set_true:N \l__chemmacros_option_upgreek_set_bool ,
greek / textgreek .code:n =
- \bool_set_false:N \l_chemmacros_use_upgreek_bool
- \bool_set_true:N \l_chemmacros_use_textgreek_bool
- \bool_set_true:N \l_chemmacros_option_upgreek_set_bool ,
+ \bool_set_false:N \l__chemmacros_use_upgreek_bool
+ \bool_set_true:N \l__chemmacros_use_textgreek_bool
+ \bool_set_true:N \l__chemmacros_option_upgreek_set_bool ,
greek / math .code:n =
- \bool_set_false:N \l_chemmacros_use_upgreek_bool
- \bool_set_false:N \l_chemmacros_use_textgreek_bool
- \bool_set_true:N \l_chemmacros_option_upgreek_set_bool ,
+ \bool_set_false:N \l__chemmacros_use_upgreek_bool
+ \bool_set_false:N \l__chemmacros_use_textgreek_bool
+ \bool_set_true:N \l__chemmacros_option_upgreek_set_bool ,
greek .default:n = upgreek ,
upgreek .code:n =
\chemmacros_msg:nnxx { chemmacros } { option-deprecated }
@@ -390,12 +390,12 @@
{ version } {} ,
cmversion .choice: ,
cmversion / 1 .code:n =
- { \bool_set_true:N \l_chemmacros_version_one_bool } ,
+ { \bool_set_true:N \l__chemmacros_version_one_bool } ,
cmversion / 2 .code:n =
- { \bool_set_false:N \l_chemmacros_version_one_bool } ,
+ { \bool_set_false:N \l__chemmacros_version_one_bool } ,
cmversion / bundle .code:n =
- { \bool_set_false:N \l_chemmacros_version_one_bool } ,
- xspace .bool_set:N = \l_chemmacros_xspace_bool ,
+ { \bool_set_false:N \l__chemmacros_version_one_bool } ,
+ xspace .bool_set:N = \l__chemmacros_xspace_bool ,
xspace .default:n = true
}
@@ -403,34 +403,34 @@
% --------------------------------------------------------------------------- %
% language settings:
-\prop_new:N \l_chemmacros_language_prop
-\prop_put:Nnn \l_chemmacros_language_prop { english } { english }
-\prop_put:Nnn \l_chemmacros_language_prop { american } { english }
-\prop_put:Nnn \l_chemmacros_language_prop { british } { english }
-\prop_put:Nnn \l_chemmacros_language_prop { german } { german }
-\prop_put:Nnn \l_chemmacros_language_prop { ngerman } { german }
-\prop_put:Nnn \l_chemmacros_language_prop { italian } { italian }
-\prop_put:Nnn \l_chemmacros_language_prop { french } { french }
+\prop_new:N \l__chemmacros_language_prop
+\prop_put:Nnn \l__chemmacros_language_prop { english } { english }
+\prop_put:Nnn \l__chemmacros_language_prop { american } { english }
+\prop_put:Nnn \l__chemmacros_language_prop { british } { english }
+\prop_put:Nnn \l__chemmacros_language_prop { german } { german }
+\prop_put:Nnn \l__chemmacros_language_prop { ngerman } { german }
+\prop_put:Nnn \l__chemmacros_language_prop { italian } { italian }
+\prop_put:Nnn \l__chemmacros_language_prop { french } { french }
-\prop_map_inline:Nn \l_chemmacros_language_prop
+\prop_map_inline:Nn \l__chemmacros_language_prop
{
- \cs_if_exist:cF { l_chemmacros_ #2 _bool }
- { \bool_new:c { l_chemmacros_ #2 _bool } }
+ \cs_if_exist:cF { l__chemmacros_ #2 _bool }
+ { \bool_new:c { l__chemmacros_ #2 _bool } }
}
\cs_new_nopar:Npn \chemmacros_set_language:
{
\prop_get:NoNTF
- \l_chemmacros_language_prop
- { \l_chemmacros_language_tl }
- \l_chemmacros_current_language_tl
+ \l__chemmacros_language_prop
+ { \l__chemmacros_language_tl }
+ \l__chemmacros_current_language_tl
{
\bool_set_true:c
- { l_chemmacros_ \l_chemmacros_current_language_tl _bool }
+ { l__chemmacros_ \l__chemmacros_current_language_tl _bool }
}
{
\chemmacros_msg:nnxx { chemmacros } { language-not-defined }
- { \l_chemmacros_language_tl } { }
+ { \l__chemmacros_language_tl } { }
}
}
@@ -438,25 +438,25 @@
{
\chemmacros_set_language:
\chemmacros_make_phases:
- \bool_if:NT \l_chemmacros_ghsystem_bool
+ \bool_if:NT \l__chemmacros_ghsystem_bool
{ \RequirePackage { ghsystem } }
- \bool_if:NT \l_chemmacros_bpchem_bool
+ \bool_if:NT \l__chemmacros_bpchem_bool
{ \RequirePackage { bpchem } }
- \bool_if:NT \l_chemmacros_xspace_bool
+ \bool_if:NT \l__chemmacros_xspace_bool
{ \RequirePackage { xspace } }
- \bool_if:NT \l_chemmacros_use_mhchem_bool
+ \bool_if:NT \l__chemmacros_use_mhchem_bool
{ \RequirePackage[ version=3 ]{ mhchem } }
- \bool_if:NF \l_chemmacros_option_upgreek_set_bool
+ \bool_if:NF \l__chemmacros_option_upgreek_set_bool
{
\@ifpackageloaded { upgreek }
- { \bool_set_true:N \l_chemmacros_use_upgreek_bool }
+ { \bool_set_true:N \l__chemmacros_use_upgreek_bool }
{
\@ifpackageloaded { textgreek }
- { \bool_set_true:N \l_chemmacros_use_textgreek_bool }
+ { \bool_set_true:N \l__chemmacros_use_textgreek_bool }
{}
}
}
- \bool_if:NTF \l_chemmacros_use_upgreek_bool
+ \bool_if:NTF \l__chemmacros_use_upgreek_bool
{
\cs_set_nopar:Npn \Chemalpha { \ensuremath { \upalpha } }
\cs_set_nopar:Npn \Chembeta { \ensuremath { \upbeta } }
@@ -474,7 +474,7 @@
\cs_set_nopar:Npn \ChemDelta { \ensuremath { \Updelta } }
}
{
- \bool_if:NT \l_chemmacros_use_textgreek_bool
+ \bool_if:NT \l__chemmacros_use_textgreek_bool
{
\cs_set_nopar:Npn \Chemalpha
{ \ensuremath { \text { \textalpha } } }
@@ -525,7 +525,7 @@
\cs_new_nopar:Npn \chemmacros_xspace:
{
- \bool_if:NT \l_chemmacros_xspace_bool
+ \bool_if:NT \l__chemmacros_xspace_bool
{ \xspace }
}
@@ -610,9 +610,9 @@
\cs_new_nopar:Npn \chemmacros_plus:
{
\bool_if:nTF
- { \l_chemmacros_circled_bool && !\l_chemmacros_circled_formal_bool }
+ { \l__chemmacros_circled_bool && !\l__chemmacros_circled_formal_bool }
{
- \bool_if:NTF \l_chemmacros_circled_chem_bool
+ \bool_if:NTF \l__chemmacros_circled_chem_bool
{ \chemmacros_fplus: }
{ \oplus }
}
@@ -622,9 +622,9 @@
\cs_new_nopar:Npn \chemmacros_minus:
{
\bool_if:nTF
- { \l_chemmacros_circled_bool && !\l_chemmacros_circled_formal_bool }
+ { \l__chemmacros_circled_bool && !\l__chemmacros_circled_formal_bool }
{
- \bool_if:NTF \l_chemmacros_circled_chem_bool
+ \bool_if:NTF \l__chemmacros_circled_chem_bool
{ \chemmacros_fminus: }
{ \ominus }
}
@@ -633,13 +633,13 @@
\cs_new_nopar:Npn \chemmacros_formal_plus:
{
- \bool_set_false:N \l_chemmacros_circled_formal_bool
+ \bool_set_false:N \l__chemmacros_circled_formal_bool
\chemmacros_plus:
}
\cs_new_nopar:Npn \chemmacros_formal_minus:
{
- \bool_set_false:N \l_chemmacros_circled_formal_bool
+ \bool_set_false:N \l__chemmacros_circled_formal_bool
\chemmacros_minus:
}
@@ -684,18 +684,18 @@
% add a possibility to let chemformula use the chemformula
% with method=chemformula, too
-\tl_new:N \l_chemmacros_chemformula_tl
+\tl_new:N \l__chemmacros_chemformula_tl
\cs_new:Npn \chemmacros_chemformula:n #1
{
- \bool_if:NTF \l_chemmacros_use_mhchem_bool
+ \bool_if:NTF \l__chemmacros_use_mhchem_bool
{ \ce { #1 } }
{
\group_begin:
\cs_set_eq:NN \chemformula_font_inner: \chemmacros_inner_font:
- \chemformula_input_cmpd:nN { #1 } \l_chemmacros_chemformula_tl
+ \chemformula_input_cmpd:nN { #1 } \l__chemmacros_chemformula_tl
\mode_if_math:TF
- { \text { \l_chemmacros_chemformula_tl } }
- { { \l_chemmacros_chemformula_tl } }
+ { \text { \l__chemmacros_chemformula_tl } }
+ { { \l__chemmacros_chemformula_tl } }
\group_end:
}
}
@@ -703,11 +703,11 @@
% --------------------------------------------------------------------------- %
% particles, charges
-\bool_new:N \l_chemmacros_charge_append_bool
-\bool_set_false:N \l_chemmacros_charge_append_bool
+\bool_new:N \l__chemmacros_charge_append_bool
+\bool_set_false:N \l__chemmacros_charge_append_bool
% \DeclareChemParticle, \RenewChemParticle
-\bool_if:NTF \l_chemmacros_use_mhchem_bool
+\bool_if:NTF \l__chemmacros_use_mhchem_bool
{
\NewDocumentCommand \DeclareChemParticle { mm }
{
@@ -747,29 +747,29 @@
{
\cs_set_nopar:Npn #1
{
- \bool_if:NTF \l_chemformula_inside_ch_bool
+ \bool_if:NTF \l__chemformula_inside_ch_bool
{
- \chemformula_input_cmpd:nN { #2 } \l_chemmacros_chemformula_tl
- \tl_set_rescan:Nno \l_chemmacros_chemformula_tl
+ \chemformula_input_cmpd:nN { #2 } \l__chemmacros_chemformula_tl
+ \tl_set_rescan:Nno \l__chemmacros_chemformula_tl
{ \ExplSyntaxOn }
- { \l_chemmacros_chemformula_tl }
- \tl_use:N \l_chemmacros_chemformula_tl
- \tl_clear:N \l_chemmacros_chemformula_tl
+ { \l__chemmacros_chemformula_tl }
+ \tl_use:N \l__chemmacros_chemformula_tl
+ \tl_clear:N \l__chemmacros_chemformula_tl
}
{
\group_begin:
\chemformula_input:n { #2 }
- \tl_set_rescan:Nno \l_chemmacros_tmpa_tl
+ \tl_set_rescan:Nno \l__chemmacros_tmpa_tl
{ \ExplSyntaxOn }
- { \l_chemformula_input_tl }
- \chemformula_write:V \l_chemmacros_tmpa_tl
+ { \l__chemformula_input_tl }
+ \chemformula_write:V \l__chemmacros_tmpa_tl
\group_end:
\chemmacros_xspace:
}
}
}
-\bool_if:NTF \l_chemmacros_use_mhchem_bool
+\bool_if:NTF \l__chemmacros_use_mhchem_bool
{
\cs_new_nopar:Npn \el { \chemmacros_atom:n { e } \mch \chemmacros_xspace: }
\cs_new_nopar:Npn \prt { \chemmacros_atom:n { p } \pch \chemmacros_xspace: }
@@ -783,14 +783,14 @@
\cs_new_nopar:Npn \chemmacros_bm:n #1
{
- \bool_if:NTF \l_chemmacros_detect_bold_bool
+ \bool_if:NTF \l__chemmacros_detect_bold_bool
{ \bm { #1 } }
{ #1 }
}
\cs_new_nopar:Npn \chemmacros_bf:n #1
{
- \bool_if:NTF \l_chemmacros_detect_bold_bool
+ \bool_if:NTF \l__chemmacros_detect_bold_bool
{ { \normalfont \bfseries #1 } }
{ { \normalfont #1 } }
}
@@ -816,7 +816,7 @@
% charges
\cs_new_nopar:Npn \chemmacros_charge:n #1
{
- \bool_if:NTF \l_chemmacros_charge_append_bool
+ \bool_if:NTF \l__chemmacros_charge_append_bool
{
\mode_if_math:TF
{ {}^ { \chemmacros_detect_bold:n { #1 } } }
@@ -831,7 +831,7 @@
\keys_define:nn { chemmacros / charges }
{
- append .bool_set:N = \l_chemmacros_charge_append_bool ,
+ append .bool_set:N = \l__chemmacros_charge_append_bool ,
append .default:n = true
}
@@ -887,7 +887,7 @@
% --------------------------------------------------------------------------- %
% ions, molecules
% proton, hydroxide, hydronium/oxonium, water, nucleophile, electrophile
-\bool_if:NTF \l_chemmacros_use_mhchem_bool
+\bool_if:NTF \l__chemmacros_use_mhchem_bool
{
\cs_new_nopar:Npn \Hpl { \chemmacros_atom:n { H } \pch \chemmacros_xspace: }
\cs_new_nopar:Npn \Hyd
@@ -908,10 +908,10 @@
\NewDocumentCommand \chemmacros_Nu:w { o }
{
\IfNoValueF { #1 } { \keys_set:nn { chemmacros / particle } { #1 } }
- \bool_if:NTF \l_chemmacros_particle_elpair_bool
+ \bool_if:NTF \l__chemmacros_particle_elpair_bool
{ \chemmacros_elpair:n { Nu } \mch }
{
- \bool_if:NTF \l_chemmacros_use_mhchem_bool
+ \bool_if:NTF \l__chemmacros_use_mhchem_bool
{ \chemmacros_atom:n { Nu } \mch }
{ \chemmacros_chemformula:n { Nu- } }
}
@@ -920,7 +920,7 @@
\AtBeginDocument
{
- \bool_if:NTF \l_chemmacros_Nu_mathspec_bool
+ \bool_if:NTF \l__chemmacros_Nu_mathspec_bool
{ \cs_set_eq:NN \Nuc \chemmacros_Nu:w }
{ \cs_set_eq:NN \Nu \chemmacros_Nu:w }
}
@@ -928,10 +928,10 @@
\NewDocumentCommand \ba { o }
{
\IfNoValueF { #1 } { \keys_set:nn { chemmacros / particle } { #1 } }
- \bool_if:NTF \l_chemmacros_particle_elpair_bool
+ \bool_if:NTF \l__chemmacros_particle_elpair_bool
{ \chemmacros_elpair:n { ba } \mch }
{
- \bool_if:NTF \l_chemmacros_use_mhchem_bool
+ \bool_if:NTF \l__chemmacros_use_mhchem_bool
{ \chemmacros_atom:n { ba } \mch }
{ \chemmacros_chemformula:n { ba- } }
}
@@ -940,9 +940,9 @@
\cs_new_nopar:Npn \chemmacros_elpair:n #1
{
- \bool_if:NTF \l_chemmacros_chemfig_bool
+ \bool_if:NTF \l__chemmacros_chemfig_bool
{
- \bool_if:NTF \l_chemmacros_elpair_dots_bool
+ \bool_if:NTF \l__chemmacros_elpair_dots_bool
{
{ \chemmacros_inner_font: #1 \Lewis { 0: , { \vphantom { #1 } } } }
}
@@ -954,70 +954,70 @@
}
}
-\bool_new:N \l_chemmacros_particle_elpair_bool
-\bool_new:N \l_chemmacros_elpair_dots_bool
+\bool_new:N \l__chemmacros_particle_elpair_bool
+\bool_new:N \l__chemmacros_elpair_dots_bool
\keys_define:nn { chemmacros / particle }
{
elpair .choice: ,
elpair / false .code:n =
- { \bool_set_false:N \l_chemmacros_particle_elpair_bool } ,
+ { \bool_set_false:N \l__chemmacros_particle_elpair_bool } ,
elpair / dots .code:n =
{
- \bool_set_true:N \l_chemmacros_particle_elpair_bool
- \bool_set_true:N \l_chemmacros_elpair_dots_bool
+ \bool_set_true:N \l__chemmacros_particle_elpair_bool
+ \bool_set_true:N \l__chemmacros_elpair_dots_bool
} ,
elpair / dash .code:n =
{
- \bool_set_true:N \l_chemmacros_particle_elpair_bool
- \bool_set_false:N \l_chemmacros_elpair_dots_bool
+ \bool_set_true:N \l__chemmacros_particle_elpair_bool
+ \bool_set_false:N \l__chemmacros_elpair_dots_bool
} ,
elpair .default:n = dots
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% IUPAC
-\prop_new:N \l_chemmacros_iupac_prop
+\prop_new:N \l__chemmacros_iupac_prop
\NewDocumentCommand \DeclareChemIUPAC { mm }
{
- \tl_set_rescan:Nnn \l_chemmacros_tmpa_tl { \char_set_catcode_letter:N \\ } { #1 }
- \tl_set:Nf \l_chemmacros_tmpa_tl { \tl_tail:V \l_chemmacros_tmpa_tl }
- \prop_if_in:NoTF \l_chemmacros_iupac_prop { \l_chemmacros_tmpa_tl }
+ \tl_set_rescan:Nnn \l__chemmacros_tmpa_tl { \char_set_catcode_letter:N \\ } { #1 }
+ \tl_set:Nf \l__chemmacros_tmpa_tl { \tl_tail:V \l__chemmacros_tmpa_tl }
+ \prop_if_in:NoTF \l__chemmacros_iupac_prop { \l__chemmacros_tmpa_tl }
{ \chemmacros_msg:nnxx { chemmacros } { declare-iupac } { #1 } { } }
- { \prop_put:Non \l_chemmacros_iupac_prop { \l_chemmacros_tmpa_tl } { #2 } }
+ { \prop_put:Non \l__chemmacros_iupac_prop { \l__chemmacros_tmpa_tl } { #2 } }
\chemmacros_make_iupac:
}
\NewDocumentCommand \RenewChemIUPAC { mm }
{
- \tl_set_rescan:Nnn \l_chemmacros_tmpa_tl { \char_set_catcode_letter:N \\ } { #1 }
- \tl_set:Nf \l_chemmacros_tmpa_tl { \tl_tail:V \l_chemmacros_tmpa_tl }
- \prop_if_in:NoTF \l_chemmacros_iupac_prop { \l_chemmacros_tmpa_tl }
- { \prop_put:Non \l_chemmacros_iupac_prop { \l_chemmacros_tmpa_tl } { #2 } }
+ \tl_set_rescan:Nnn \l__chemmacros_tmpa_tl { \char_set_catcode_letter:N \\ } { #1 }
+ \tl_set:Nf \l__chemmacros_tmpa_tl { \tl_tail:V \l__chemmacros_tmpa_tl }
+ \prop_if_in:NoTF \l__chemmacros_iupac_prop { \l__chemmacros_tmpa_tl }
+ { \prop_put:Non \l__chemmacros_iupac_prop { \l__chemmacros_tmpa_tl } { #2 } }
{ \chemmacros_msg:nnxx { chemmacros } { renew-iupac } { #1 } { } }
\chemmacros_make_iupac:
}
\cs_new_nopar:Npn \chemmacros_make_iupac:
{
- \bool_if:NT \l_chemmacros_in_document_bool
+ \bool_if:NT \l__chemmacros_in_document_bool
{
- \bool_if:NTF \l_chemmacros_inside_iupac_bool
+ \bool_if:NTF \l__chemmacros_inside_iupac_bool
{
- \prop_map_inline:Nn \l_chemmacros_iupac_prop
+ \prop_map_inline:Nn \l__chemmacros_iupac_prop
{ \cs_set_protected_nopar:cpn { ##1 } { ##2 } }
}
{
- \bool_if:NF \l_chemmacros_iupac_restricted_bool
+ \bool_if:NF \l__chemmacros_iupac_restricted_bool
{
- \bool_if:NTF \l_chemmacros_iupac_strict_bool
+ \bool_if:NTF \l__chemmacros_iupac_strict_bool
{
- \prop_map_inline:Nn \l_chemmacros_iupac_prop
+ \prop_map_inline:Nn \l__chemmacros_iupac_prop
{ \cs_set_protected_nopar:cpn { ##1 } { ##2 } }
}
{
- \prop_map_inline:Nn \l_chemmacros_iupac_prop
+ \prop_map_inline:Nn \l__chemmacros_iupac_prop
{
\cs_if_exist:cF { ##1 }
{ \cs_set_protected_nopar:cpn { ##1 } { ##2 } }
@@ -1032,17 +1032,17 @@
% stereo descriptors and other nomenclature commands
% Cahn-Ingold-Prelog
-\dim_new:N \l_chemmacros_cip_kern_dim
-\dim_set:Nn \l_chemmacros_cip_kern_dim { .05ex }
+\dim_new:N \l__chemmacros_cip_kern_dim
+\dim_set:Nn \l__chemmacros_cip_kern_dim { .05ex }
\keys_define:nn { chemmacros / iupac }
- { cip-kern .dim_set:N = \l_chemmacros_cip_kern_dim }
+ { cip-kern .dim_set:N = \l__chemmacros_cip_kern_dim }
\NewDocumentCommand \cip { m }
{
\cs_if_exist:NTF \EmbracOff
{ \textit* { (#1) } }
{ \textit { (#1) } }
- \tex_kern:D \l_chemmacros_cip_kern_dim
+ \tex_kern:D \l__chemmacros_cip_kern_dim
}
\cs_new_protected_nopar:Npn \Rcip
@@ -1116,15 +1116,15 @@
\DeclareChemIUPAC \anti { \textit { anti } }
% coordination chemistry
-\bool_new:N \l_chemmacros_bridge_super_bool
+\bool_new:N \l__chemmacros_bridge_super_bool
\keys_define:nn { chemmacros / iupac }
{
bridge-number .choice: ,
bridge-number / sub .code:n =
- \bool_set_false:N \l_chemmacros_bridge_super_bool ,
+ \bool_set_false:N \l__chemmacros_bridge_super_bool ,
bridge-number / super .code:n =
- \bool_set_true:N \l_chemmacros_bridge_super_bool ,
- coord-use-hyphen .bool_set:N = \l_chemmacros_coord_use_hyphen_bool ,
+ \bool_set_true:N \l__chemmacros_bridge_super_bool ,
+ coord-use-hyphen .bool_set:N = \l__chemmacros_coord_use_hyphen_bool ,
coord-use-hyphen .default:n = true
}
@@ -1135,7 +1135,7 @@
{
\Chemmu \tl_if_blank:nF { #1 }
{
- \bool_if:NTF \l_chemmacros_bridge_super_bool
+ \bool_if:NTF \l__chemmacros_bridge_super_bool
{ \chemformula_superscript:n { #1 } }
{ \chemformula_subscript:n { #1 } }
}
@@ -1155,7 +1155,7 @@
% language specific settings
\AtBeginDocument
{
- \bool_if:NT \l_chemmacros_italian_bool
+ \bool_if:NT \l__chemmacros_italian_bool
{
\DeclareChemIUPAC \sin { \textit { sin } }
\DeclareChemIUPAC \ter { \textit { ter } }
@@ -1182,18 +1182,18 @@
\cs_new_protected:Nn \chemmacros_allow_hyphens:
{ \tex_penalty:D \c_ten_thousand \skip_horizontal:n { \c_zero_dim } }
-\dim_new:N \l_chemmacros_iupac_hyphen_pre_dim
-\dim_set:Nn \l_chemmacros_iupac_hyphen_pre_dim { .01em }
-\dim_new:N \l_chemmacros_iupac_hyphen_post_dim
-\dim_set:Nn \l_chemmacros_iupac_hyphen_post_dim { -.03em }
-\dim_new:N \l_chemmacros_iupac_break_dim
-\dim_set:Nn \l_chemmacros_iupac_break_dim { .03em }
+\dim_new:N \l__chemmacros_iupac_hyphen_pre_dim
+\dim_set:Nn \l__chemmacros_iupac_hyphen_pre_dim { .01em }
+\dim_new:N \l__chemmacros_iupac_hyphen_post_dim
+\dim_set:Nn \l__chemmacros_iupac_hyphen_post_dim { -.03em }
+\dim_new:N \l__chemmacros_iupac_break_dim
+\dim_set:Nn \l__chemmacros_iupac_break_dim { .03em }
\keys_define:nn { chemmacros / iupac }
{
- hyphen-pre-space .dim_set:N = \l_chemmacros_iupac_hyphen_pre_dim ,
- hyphen-post-space .dim_set:N = \l_chemmacros_iupac_hyphen_post_dim ,
- break-space .dim_set:N = \l_chemmacros_iupac_break_dim
+ hyphen-pre-space .dim_set:N = \l__chemmacros_iupac_hyphen_pre_dim ,
+ hyphen-post-space .dim_set:N = \l__chemmacros_iupac_hyphen_post_dim ,
+ break-space .dim_set:N = \l__chemmacros_iupac_break_dim
}
\cs_new_protected:Nn \chemmacros_break_point_hyphen:
@@ -1201,9 +1201,9 @@
\tex_penalty:D \c_ten_thousand
\tex_discretionary:D { - } { }
{
- \tex_kern:D \l_chemmacros_iupac_hyphen_pre_dim
+ \tex_kern:D \l__chemmacros_iupac_hyphen_pre_dim
-
- \tex_kern:D \l_chemmacros_iupac_hyphen_post_dim
+ \tex_kern:D \l__chemmacros_iupac_hyphen_post_dim
}
\chemmacros_allow_hyphens:
}
@@ -1212,16 +1212,16 @@
{
\tex_penalty:D \c_ten_thousand
\tex_discretionary:D { - } { }
- { \tex_kern:D \l_chemmacros_iupac_break_dim }
+ { \tex_kern:D \l__chemmacros_iupac_break_dim }
\chemmacros_allow_hyphens:
}
-\bool_new:N \l_chemmacros_inside_iupac_bool
+\bool_new:N \l__chemmacros_inside_iupac_bool
\cs_new_protected:Nn \chemmacros_iupac:n
{
\group_begin:
- \bool_set_true:N \l_chemmacros_inside_iupac_bool
+ \bool_set_true:N \l__chemmacros_inside_iupac_bool
\chemmacros_make_iupac:
\chemmacros_ignore_spaces:
\cs_set_eq:NN \- \chemmacros_break_point_hyphen:
@@ -1240,36 +1240,36 @@
\cs_set_eq:NN \iupac \chemmacros_iupac:n
% latin phrases
-\tl_new:N \l_chemmacros_latin_format_tl
-\tl_set:Nn \l_chemmacros_latin_format_tl { \itshape }
+\tl_new:N \l__chemmacros_latin_format_tl
+\tl_set:Nn \l__chemmacros_latin_format_tl { \itshape }
\keys_define:nn { chemmacros / latin }
- { format . tl_set:N = \l_chemmacros_latin_format_tl }
+ { format . tl_set:N = \l__chemmacros_latin_format_tl }
\cs_new:Npn \chemmacros_latin:n #1
- { { \l_chemmacros_latin_format_tl #1 } }
+ { { \l__chemmacros_latin_format_tl #1 } }
-\prop_new:N \l_chemmacros_latin_prop
+\prop_new:N \l__chemmacros_latin_prop
\NewDocumentCommand \DeclareChemLatin { mm }
{
\cs_if_free:NTF #1
{
\cs_new:Npn #1 { \chemmacros_latin:n { #2 } \chemmacros_xspace: }
- \prop_put:Nnn \l_chemmacros_latin_prop { #1 } { #2 }
+ \prop_put:Nnn \l__chemmacros_latin_prop { #1 } { #2 }
}
{ \chemmacros_msg:nnxx { chemmacros } { declare-latin } { #1 } { } }
}
\NewDocumentCommand \RenewChemLatin { mm }
{
- \prop_if_in:NnTF \l_chemmacros_latin_prop { #1 }
+ \prop_if_in:NnTF \l__chemmacros_latin_prop { #1 }
{ \cs_set:Npn #1 { \chemmacros_latin:n { #2 } \chemmacros_xspace: } }
{ \chemmacros_msg:nnxx { chemmacros } { renew-latin } { #1 } { } }
}
\AtBeginDocument
{
- \bool_if:NTF \l_chemmacros_chemstyle_bool
+ \bool_if:NTF \l__chemmacros_chemstyle_bool
{
\AfterPackage* { chemstyle }
{
@@ -1299,7 +1299,7 @@
\cs_new_nopar:Npn \chemmacros_if_bold:TF #1#2
{
- \ifx\f@series\l_chemmacros_if_bf_tl
+ \ifx\f@series\l__chemmacros_if_bf_tl
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
@@ -1307,8 +1307,8 @@
{ #1 }{ #2 }
}
-\tl_new:N \l_chemmacros_if_bf_tl
-\tl_set:Nn \l_chemmacros_if_bf_tl { bx }
+\tl_new:N \l__chemmacros_if_bf_tl
+\tl_set:Nn \l__chemmacros_if_bf_tl { bx }
\cs_new_protected_nopar:Npn \Ka
{
@@ -1318,7 +1318,7 @@
\chemmacros_detect_bold:n
{
K \c_math_subscript_token \mathrm
- { \bool_if:NTF \l_chemmacros_german_bool { S } { A } }
+ { \bool_if:NTF \l__chemmacros_german_bool { S } { A } }
}
\)
}
@@ -1391,7 +1391,7 @@
\DeclareSIUnit { \cal } { cal }
\AtBeginDocument
{
- \bool_if:NF \l_chemmacros_chemstyle_bool
+ \bool_if:NF \l__chemmacros_chemstyle_bool
{
\DeclareSIUnit { \cmc } { \cubic\centi\metre }
\DeclareSIUnit { \molar } { \mole\per\cubic\deci\metre }
@@ -1408,15 +1408,15 @@
% \mech[<type>]
% <type> - substitutions: {}, 1, 2, se, 1e, 2e, ar
% - eliminations: e, e1, e2, cb
-\tl_new:N \l_chemmacros_mech_type_tl
-\tl_new:N \l_chemmacros_mech_mol_tl
-\tl_new:N \l_chemmacros_mech_ar_tl
+\tl_new:N \l__chemmacros_mech_type_tl
+\tl_new:N \l__chemmacros_mech_mol_tl
+\tl_new:N \l__chemmacros_mech_ar_tl
\cs_new_nopar:Npn \chemmacros_set_mech:nnn #1#2#3
{
- \tl_set:Nn \l_chemmacros_mech_type_tl { #1 }
- \tl_set:Nn \l_chemmacros_mech_mol_tl { #2 }
- \tl_set:Nn \l_chemmacros_mech_ar_tl { #3 }
+ \tl_set:Nn \l__chemmacros_mech_type_tl { #1 }
+ \tl_set:Nn \l__chemmacros_mech_mol_tl { #2 }
+ \tl_set:Nn \l__chemmacros_mech_ar_tl { #3 }
}
\keys_define:nn { chemmacros / mech }
@@ -1478,9 +1478,9 @@
{ \keys_set:nn { chemmacros / mech } { type = #1 } }
\mbox
{
- \tl_use:N \l_chemmacros_mech_ar_tl
- \tl_use:N \l_chemmacros_mech_type_tl
- \tl_use:N \l_chemmacros_mech_mol_tl
+ \tl_use:N \l__chemmacros_mech_ar_tl
+ \tl_use:N \l__chemmacros_mech_type_tl
+ \tl_use:N \l__chemmacros_mech_mol_tl
}
\chemmacros_xspace:
}
@@ -1488,33 +1488,33 @@
% --------------------------------------------------------------------------- %
% oxidation numbers
% \ox{<number>,<atom>}
-\bool_new:N \l_chemmacros_ox_sign_bool
-\bool_new:N \l_chemmacros_ox_integer_bool
+\bool_new:N \l__chemmacros_ox_sign_bool
+\bool_new:N \l__chemmacros_ox_integer_bool
-\bool_new:N \l_chemmacros_ox_explicit_sign_bool
-\bool_set_false:N \l_chemmacros_ox_explicit_sign_bool
+\bool_new:N \l__chemmacros_ox_explicit_sign_bool
+\bool_set_false:N \l__chemmacros_ox_explicit_sign_bool
-\bool_new:N \l_chemmacros_ox_format_roman_bool
-\bool_set_true:N \l_chemmacros_ox_format_roman_bool
+\bool_new:N \l__chemmacros_ox_format_roman_bool
+\bool_set_true:N \l__chemmacros_ox_format_roman_bool
-\bool_new:N \l_chemmacros_ox_decimal_marker_comma_bool
-\bool_set_false:N \l_chemmacros_ox_decimal_marker_comma_bool
+\bool_new:N \l__chemmacros_ox_decimal_marker_comma_bool
+\bool_set_false:N \l__chemmacros_ox_decimal_marker_comma_bool
-\bool_new:N \l_chemmacros_ox_parse_bool
-\bool_set_true:N \l_chemmacros_ox_parse_bool
+\bool_new:N \l__chemmacros_ox_parse_bool
+\bool_set_true:N \l__chemmacros_ox_parse_bool
-\int_new:N \l_chemmacros_ox_number_int
-\fp_new:N \l_chemmacros_ox_number_fp
+\int_new:N \l__chemmacros_ox_number_int
+\fp_new:N \l__chemmacros_ox_number_fp
-\bool_new:N \l_chemmacros_ox_side_bool
-\bool_new:N \l_chemmacros_ox_super_bool
-\bool_new:N \l_chemmacros_ox_top_bool
-\bool_set_true:N \l_chemmacros_ox_top_bool
-\bool_new:N \l_chemmacros_ox_align_center_bool
+\bool_new:N \l__chemmacros_ox_side_bool
+\bool_new:N \l__chemmacros_ox_super_bool
+\bool_new:N \l__chemmacros_ox_top_bool
+\bool_set_true:N \l__chemmacros_ox_top_bool
+\bool_new:N \l__chemmacros_ox_align_center_bool
\cs_new_nopar:Npn \chemmacros_ox_process_number:n #1
{
- \bool_if:NTF \l_chemmacros_ox_parse_bool
+ \bool_if:NTF \l__chemmacros_ox_parse_bool
{
\tl_if_in:nnTF { #1 } { / }
{ \chemmacros_ox_fraction:n #1 }
@@ -1538,9 +1538,9 @@
\cs_new_nopar:Npn \chemmacros_ox_fraction:n #1/#2
{
- \bool_set_false:N \l_chemmacros_ox_format_roman_bool
+ \bool_set_false:N \l__chemmacros_ox_format_roman_bool
\chemmacros_ox_sign:n { #1 }
- \bool_if:NTF \l_chemmacros_ox_side_bool
+ \bool_if:NTF \l__chemmacros_ox_side_bool
{ \sfrac { \chemmacros_ox_value:n { #1 } } { #2 } }
{ \sfrac [ chemmacros-ox-frac ] { \chemmacros_ox_value:n { #1 } } { #2 } }
}
@@ -1548,40 +1548,40 @@
\cs_new_nopar:Npn \chemmacros_ox_sign:n #1
{
\fp_compare:nNnT { #1 } > { 0 }
- { \bool_if:NT \l_chemmacros_ox_explicit_sign_bool { $+$ } }
+ { \bool_if:NT \l__chemmacros_ox_explicit_sign_bool { $+$ } }
\fp_compare:nNnT { #1 } = { 0 }
- { \bool_if:NT \l_chemmacros_ox_explicit_sign_bool { $\pm$ } }
+ { \bool_if:NT \l__chemmacros_ox_explicit_sign_bool { $\pm$ } }
\fp_compare:nNnT { #1 } < { 0 }
{ $-$ }
}
\cs_new_nopar:Npn \chemmacros_ox_value:n #1
{
- \fp_set:Nn \l_chemmacros_ox_number_fp { #1 }
- \fp_abs:N \l_chemmacros_ox_number_fp
- \chemmacros_ox_is_integer:N \l_chemmacros_ox_number_fp
- \bool_if:NTF \l_chemmacros_ox_format_roman_bool
+ \fp_set:Nn \l__chemmacros_ox_number_fp { #1 }
+ \fp_abs:N \l__chemmacros_ox_number_fp
+ \chemmacros_ox_is_integer:N \l__chemmacros_ox_number_fp
+ \bool_if:NTF \l__chemmacros_ox_format_roman_bool
{
- \chemmacros_fp_to_Roman:N \l_chemmacros_ox_number_fp
+ \chemmacros_fp_to_Roman:N \l__chemmacros_ox_number_fp
}
{
- \bool_if:NTF \l_chemmacros_ox_integer_bool
- { \chemmacros_fp_to_arabic:N \l_chemmacros_ox_number_fp }
- { \chemmacros_fp_show:N \l_chemmacros_ox_number_fp }
+ \bool_if:NTF \l__chemmacros_ox_integer_bool
+ { \chemmacros_fp_to_arabic:N \l__chemmacros_ox_number_fp }
+ { \chemmacros_fp_show:N \l__chemmacros_ox_number_fp }
}
}
\cs_new_nopar:Npn \chemmacros_ox_is_integer:n #1
{
- \fp_set:Nn \l_chemmacros_tmpa_tl { #1 }
- \fp_add:Nn \l_chemmacros_tmpa_tl { 1 }
- \fp_round_places:Nn \l_chemmacros_tmpa_tl { 0 }
- \fp_sub:Nn \l_chemmacros_tmpa_tl { 1 }
- \fp_compare:nNnTF { \l_chemmacros_tmpa_tl } = { #1 }
- { \bool_set_true:N \l_chemmacros_ox_integer_bool }
+ \fp_set:Nn \l__chemmacros_tmpa_tl { #1 }
+ \fp_add:Nn \l__chemmacros_tmpa_tl { 1 }
+ \fp_round_places:Nn \l__chemmacros_tmpa_tl { 0 }
+ \fp_sub:Nn \l__chemmacros_tmpa_tl { 1 }
+ \fp_compare:nNnTF { \l__chemmacros_tmpa_tl } = { #1 }
+ { \bool_set_true:N \l__chemmacros_ox_integer_bool }
{
- \bool_set_false:N \l_chemmacros_ox_integer_bool
- \bool_set_false:N \l_chemmacros_ox_format_roman_bool
+ \bool_set_false:N \l__chemmacros_ox_integer_bool
+ \bool_set_false:N \l__chemmacros_ox_format_roman_bool
}
}
\cs_generate_variant:Nn \chemmacros_ox_is_integer:n { N }
@@ -1589,12 +1589,12 @@
\cs_new_nopar:Npn \chemmacros_fp_to_Roman:n #1
{
\group_begin:
- \fp_set:Nn \l_chemmacros_tmpa_tl { #1 }
- \fp_round_places:Nn \l_chemmacros_tmpa_tl { 0 }
- \int_set:Nn \l_chemmacros_tmpa_int { \fp_to_tl:N \l_chemmacros_tmpa_tl }
- \int_compare:nTF { \l_chemmacros_tmpa_int = 0 }
+ \fp_set:Nn \l__chemmacros_tmpa_tl { #1 }
+ \fp_round_places:Nn \l__chemmacros_tmpa_tl { 0 }
+ \int_set:Nn \l__chemmacros_tmpa_int { \fp_to_tl:N \l__chemmacros_tmpa_tl }
+ \int_compare:nTF { \l__chemmacros_tmpa_int = 0 }
{ 0 }
- { \int_to_Roman:n { \int_use:N \l_chemmacros_tmpa_int } }
+ { \int_to_Roman:n { \int_use:N \l__chemmacros_tmpa_int } }
\group_end:
}
\cs_generate_variant:Nn \chemmacros_fp_to_Roman:n { N }
@@ -1602,8 +1602,8 @@
\cs_new_nopar:Npn \chemmacros_fp_to_arabic:n #1
{
\group_begin:
- \fp_set:Nn \l_chemmacros_tmpa_tl { #1 }
- \fp_to_tl:N \l_chemmacros_tmpa_tl
+ \fp_set:Nn \l__chemmacros_tmpa_tl { #1 }
+ \fp_to_tl:N \l__chemmacros_tmpa_tl
\group_end:
}
\cs_generate_variant:Nn \chemmacros_fp_to_arabic:n { N }
@@ -1611,14 +1611,14 @@
\cs_new_nopar:Npn \chemmacros_fp_show:n #1
{
\group_begin:
- \fp_set:Nn \l_chemmacros_tmpa_tl { #1 }
- \bool_if:NTF \l_chemmacros_ox_decimal_marker_comma_bool
+ \fp_set:Nn \l__chemmacros_tmpa_tl { #1 }
+ \bool_if:NTF \l__chemmacros_ox_decimal_marker_comma_bool
{
- \tl_set:Nx \l_chemmacros_tmpb_tl { \fp_to_tl:N \l_chemmacros_tmpa_tl }
- \tl_replace_once:Nnn \l_chemmacros_tmpb_tl { . } { {,} }
- \tl_use:N \l_chemmacros_tmpb_tl
+ \tl_set:Nx \l__chemmacros_tmpb_tl { \fp_to_tl:N \l__chemmacros_tmpa_tl }
+ \tl_replace_once:Nnn \l__chemmacros_tmpb_tl { . } { {,} }
+ \tl_use:N \l__chemmacros_tmpb_tl
}
- { \fp_to_tl:N \l_chemmacros_tmpa_tl }
+ { \fp_to_tl:N \l__chemmacros_tmpa_tl }
\group_end:
}
\cs_generate_variant:Nn \chemmacros_fp_show:n { N }
@@ -1635,7 +1635,7 @@
}
\ensuremath
{
- \bool_if:NT \l_chemmacros_ox_super_bool
+ \bool_if:NT \l__chemmacros_ox_super_bool
{
\chemmacros_text:n
{
@@ -1643,16 +1643,16 @@
$ ^ { \text { \tiny \chemmacros_ox_process_number:n { #1 } } } $
}
}
- \bool_if:NT \l_chemmacros_ox_side_bool
+ \bool_if:NT \l__chemmacros_ox_side_bool
{
\chemmacros_text:n
{ #2 ( \text { \chemmacros_ox_process_number:n { #1 } } ) }
}
- \bool_if:NT \l_chemmacros_ox_top_bool
+ \bool_if:NT \l__chemmacros_ox_top_bool
{
\overset
{
- \bool_if:NTF \l_chemmacros_ox_align_center_bool
+ \bool_if:NTF \l__chemmacros_ox_align_center_bool
{ \clap } { \rlap }
{
\chemmacros_text:n
@@ -1666,23 +1666,23 @@
\cs_new_nopar:Npn \chemmacros_ox_pos_top:
{
- \bool_set_true:N \l_chemmacros_ox_top_bool
- \bool_set_false:N \l_chemmacros_ox_super_bool
- \bool_set_false:N \l_chemmacros_ox_side_bool
+ \bool_set_true:N \l__chemmacros_ox_top_bool
+ \bool_set_false:N \l__chemmacros_ox_super_bool
+ \bool_set_false:N \l__chemmacros_ox_side_bool
}
\cs_new_nopar:Npn \chemmacros_ox_pos_super:
{
- \bool_set_false:N \l_chemmacros_ox_top_bool
- \bool_set_true:N \l_chemmacros_ox_super_bool
- \bool_set_false:N \l_chemmacros_ox_side_bool
+ \bool_set_false:N \l__chemmacros_ox_top_bool
+ \bool_set_true:N \l__chemmacros_ox_super_bool
+ \bool_set_false:N \l__chemmacros_ox_side_bool
}
\cs_new_nopar:Npn \chemmacros_ox_pos_side:
{
- \bool_set_false:N \l_chemmacros_ox_top_bool
- \bool_set_false:N \l_chemmacros_ox_super_bool
- \bool_set_true:N \l_chemmacros_ox_side_bool
+ \bool_set_false:N \l__chemmacros_ox_top_bool
+ \bool_set_false:N \l__chemmacros_ox_super_bool
+ \bool_set_true:N \l__chemmacros_ox_side_bool
}
\keys_define:nn { chemmacros / ox }
@@ -1691,20 +1691,20 @@
pos / top .code:n = \chemmacros_ox_pos_top: ,
pos / super .code:n = \chemmacros_ox_pos_super: ,
pos / side .code:n = \chemmacros_ox_pos_side: ,
- roman .bool_set:N = \l_chemmacros_ox_format_roman_bool ,
+ roman .bool_set:N = \l__chemmacros_ox_format_roman_bool ,
roman .default:n = true ,
- parse .bool_set:N = \l_chemmacros_ox_parse_bool ,
+ parse .bool_set:N = \l__chemmacros_ox_parse_bool ,
parse .default:n = true ,
- explicit-sign .bool_set:N = \l_chemmacros_ox_explicit_sign_bool ,
+ explicit-sign .bool_set:N = \l__chemmacros_ox_explicit_sign_bool ,
explicit-sign .default:n = true ,
decimal-marker .choice: ,
decimal-marker / comma .code:n =
- { \bool_set_true:N \l_chemmacros_ox_decimal_marker_comma_bool } ,
+ { \bool_set_true:N \l__chemmacros_ox_decimal_marker_comma_bool } ,
decimal-marker / point .code:n =
- { \bool_set_false:N \l_chemmacros_ox_decimal_marker_comma_bool } ,
+ { \bool_set_false:N \l__chemmacros_ox_decimal_marker_comma_bool } ,
align .choice: ,
- align / center .code:n = \bool_set_true:N \l_chemmacros_ox_align_center_bool ,
- align / right .code:n = \bool_set_false:N \l_chemmacros_ox_align_center_bool
+ align / center .code:n = \bool_set_true:N \l__chemmacros_ox_align_center_bool ,
+ align / right .code:n = \bool_set_false:N \l__chemmacros_ox_align_center_bool
}
% \ox[<keyval>]{<num>,<atom>}
@@ -1713,7 +1713,7 @@
{
\group_begin:
\IfBooleanT { #1 } { \chemmacros_ox_pos_super: }
- \bool_if:NTF \l_chemmacros_version_one_bool
+ \bool_if:NTF \l__chemmacros_version_one_bool
{ \keys_set:nn { chemmacros / ox } { parse = false } }
{ \IfNoValueF { #2 } { \keys_set:nn { chemmacros / ox } { #2 } } }
\chemmacros_ox:nn #3
@@ -1722,24 +1722,24 @@
% --------------------------------------------------------------------------- %
% - oxidation arrows
-\tl_new:N \l_chemmacros_redox_begin_tl
-\tl_new:N \l_chemmacros_redox_end_tl
+\tl_new:N \l__chemmacros_redox_begin_tl
+\tl_new:N \l__chemmacros_redox_end_tl
-\tl_new:N \l_chemmacros_redox_tikz_tl
+\tl_new:N \l__chemmacros_redox_tikz_tl
-\fp_new:N \l_chemmacros_redox_shift_fp
-\tl_new:N \l_chemmacros_redox_shift_tl
+\fp_new:N \l__chemmacros_redox_shift_fp
+\tl_new:N \l__chemmacros_redox_shift_tl
-\tl_new:N \l_chemmacros_redox_anchor_tl
+\tl_new:N \l__chemmacros_redox_anchor_tl
-\tl_new:N \l_chemmacros_redox_side_tl
+\tl_new:N \l__chemmacros_redox_side_tl
-\dim_new:N \l_chemmacros_redox_sep_dim
-\dim_new:N \l_chemmacros_redox_sep_default_dim
-\dim_set:Nn \l_chemmacros_redox_sep_default_dim { .2em }
+\dim_new:N \l__chemmacros_redox_sep_dim
+\dim_new:N \l__chemmacros_redox_sep_default_dim
+\dim_set:Nn \l__chemmacros_redox_sep_default_dim { .2em }
-\dim_new:N \l_chemmacros_redox_dist_dim
-\dim_set:Nn \l_chemmacros_redox_dist_dim {.6em}
+\dim_new:N \l__chemmacros_redox_dist_dim
+\dim_set:Nn \l__chemmacros_redox_dist_dim {.6em}
% place and name nodes:
% \OX{<name>,<atom>}
@@ -1764,8 +1764,8 @@
\cs_new_nopar:Npn \chemmacros_redox_coordinates:nn #1#2
{
- \tl_set:Nn \l_chemmacros_redox_begin_tl { #1 }
- \tl_set:Nn \l_chemmacros_redox_end_tl { #2 }
+ \tl_set:Nn \l__chemmacros_redox_begin_tl { #1 }
+ \tl_set:Nn \l__chemmacros_redox_end_tl { #2 }
}
\NewDocumentCommand \redox { > { \SplitArgument { 1 } { , } } r() o o G{} }
@@ -1775,53 +1775,53 @@
\msg_error:nnx { chemmacros } { redox }
{ You~need~to~specify~coordinates }
}
- \tl_clear:N \l_chemmacros_redox_begin_tl
- \tl_clear:N \l_chemmacros_redox_end_tl
- \tl_clear:N \l_chemmacros_redox_tikz_tl
+ \tl_clear:N \l__chemmacros_redox_begin_tl
+ \tl_clear:N \l__chemmacros_redox_end_tl
+ \tl_clear:N \l__chemmacros_redox_tikz_tl
\chemmacros_redox_coordinates:nn #1
\IfNoValueF { #2 }
- { \tl_set:Nn \l_chemmacros_redox_tikz_tl { #2 } }
+ { \tl_set:Nn \l__chemmacros_redox_tikz_tl { #2 } }
\IfNoValueTF { #3 }
{
- \fp_set:Nn \l_chemmacros_redox_shift_fp { 1 }
- \tl_set:Nn \l_chemmacros_redox_anchor_tl { above }
- \tl_set:Nn \l_chemmacros_redox_side_tl { north }
+ \fp_set:Nn \l__chemmacros_redox_shift_fp { 1 }
+ \tl_set:Nn \l__chemmacros_redox_anchor_tl { above }
+ \tl_set:Nn \l__chemmacros_redox_side_tl { north }
\dim_set_eq:NN
- \l_chemmacros_redox_sep_dim
- \l_chemmacros_redox_sep_default_dim
+ \l__chemmacros_redox_sep_dim
+ \l__chemmacros_redox_sep_default_dim
}
{
\fp_compare:nNnTF { #3 } < { 0 }
{
- \tl_set:Nn \l_chemmacros_redox_anchor_tl { below }
- \tl_set:Nn \l_chemmacros_redox_side_tl { south }
- \exp_args:NNo \dim_set:Nn \l_chemmacros_redox_sep_dim
- { - \l_chemmacros_redox_sep_default_dim }
+ \tl_set:Nn \l__chemmacros_redox_anchor_tl { below }
+ \tl_set:Nn \l__chemmacros_redox_side_tl { south }
+ \exp_args:NNo \dim_set:Nn \l__chemmacros_redox_sep_dim
+ { - \l__chemmacros_redox_sep_default_dim }
}
{
- \tl_set:Nn \l_chemmacros_redox_anchor_tl { above }
- \tl_set:Nn \l_chemmacros_redox_side_tl { north }
+ \tl_set:Nn \l__chemmacros_redox_anchor_tl { above }
+ \tl_set:Nn \l__chemmacros_redox_side_tl { north }
\dim_set_eq:NN
- \l_chemmacros_redox_sep_dim
- \l_chemmacros_redox_sep_default_dim
+ \l__chemmacros_redox_sep_dim
+ \l__chemmacros_redox_sep_default_dim
}
- \fp_set:Nn \l_chemmacros_redox_shift_fp { #3 }
+ \fp_set:Nn \l__chemmacros_redox_shift_fp { #3 }
}
- \tl_set:Nn \l_chemmacros_redox_shift_tl
- { \fp_to_tl:N \l_chemmacros_redox_shift_fp }
+ \tl_set:Nn \l__chemmacros_redox_shift_tl
+ { \fp_to_tl:N \l__chemmacros_redox_shift_fp }
\tikz[remember~picture,overlay]
{
- \chemmacros_tikz_draw:f { \tl_use:N \l_chemmacros_redox_tikz_tl }
+ \chemmacros_tikz_draw:f { \tl_use:N \l__chemmacros_redox_tikz_tl }
($
- (\l_chemmacros_redox_begin_tl .
- \l_chemmacros_redox_side_tl)+(0,\l_chemmacros_redox_sep_dim)
+ (\l__chemmacros_redox_begin_tl .
+ \l__chemmacros_redox_side_tl)+(0,\l__chemmacros_redox_sep_dim)
$)
--
- ++(0,\l_chemmacros_redox_shift_tl * \l_chemmacros_redox_dist_dim) -|
- node [pos=.25,\l_chemmacros_redox_anchor_tl] { { #4 } }
+ ++(0,\l__chemmacros_redox_shift_tl * \l__chemmacros_redox_dist_dim) -|
+ node [pos=.25,\l__chemmacros_redox_anchor_tl] { { #4 } }
($
- (\l_chemmacros_redox_end_tl .
- \l_chemmacros_redox_side_tl)+(0,\l_chemmacros_redox_sep_dim)
+ (\l__chemmacros_redox_end_tl .
+ \l__chemmacros_redox_side_tl)+(0,\l__chemmacros_redox_sep_dim)
$) ;
}
}
@@ -1829,107 +1829,107 @@
% redox-keys
\keys_define:nn { chemmacros / redox }
{
- dist .dim_set:N = \l_chemmacros_redox_dist_dim ,
+ dist .dim_set:N = \l__chemmacros_redox_dist_dim ,
dist .default:n = { .6em } ,
- sep .dim_set:N = \l_chemmacros_redox_sep_default_dim ,
+ sep .dim_set:N = \l__chemmacros_redox_sep_default_dim ,
sep .default:n = { .2em }
}
-\bool_if:NT \l_chemmacros_version_one_bool
+\bool_if:NT \l__chemmacros_version_one_bool
{
\NewDocumentCommand \setredoxdist { m }
{
\tl_if_blank:nTF { #1 }
- { \dim_set:Nn \l_chemmacros_redox_dist_dim { .6em } }
- { \dim_set:Nn \l_chemmacros_redox_dist_dim { #1 } }
+ { \dim_set:Nn \l__chemmacros_redox_dist_dim { .6em } }
+ { \dim_set:Nn \l__chemmacros_redox_dist_dim { #1 } }
}
}
% --------------------------------------------------------------------------- %
% spectroscopy
-\tl_new:N \g_chemmacros_nmr_isotope_tl
-\tl_new:N \l_chemmacros_nmr_isotope_default_tl
-\tl_set:Nn \l_chemmacros_nmr_isotope_default_tl { 1 }
-
-\tl_new:N \l_chemmacros_nmr_coupling_nuclei_tl
-\tl_new:N \l_chemmacros_nmr_coupling_bonds_tl
-\tl_new:N \g_chemmacros_nmr_element_coupled_tl
-
-\tl_new:N \g_chemmacros_nmr_element_tl
-\tl_new:N \l_chemmacros_nmr_element_default_tl
-\tl_set:Nn \l_chemmacros_nmr_element_default_tl { H }
-\tl_new:N \l_chemmacros_nmr_format_tl
-\tl_new:N \l_chemmacros_nmr_delta_tl
-\tl_new:N \l_chemmacros_nmr_coupling_unit_tl
-\tl_set:Nn \l_chemmacros_nmr_coupling_unit_tl { \hertz }
-\tl_new:N \l_chemmacros_nmr_list_setup_tl
-\tl_set:Nn \l_chemmacros_nmr_list_setup_tl
+\tl_new:N \g__chemmacros_nmr_isotope_tl
+\tl_new:N \l__chemmacros_nmr_isotope_default_tl
+\tl_set:Nn \l__chemmacros_nmr_isotope_default_tl { 1 }
+
+\tl_new:N \l__chemmacros_nmr_coupling_nuclei_tl
+\tl_new:N \l__chemmacros_nmr_coupling_bonds_tl
+\tl_new:N \g__chemmacros_nmr_element_coupled_tl
+
+\tl_new:N \g__chemmacros_nmr_element_tl
+\tl_new:N \l__chemmacros_nmr_element_default_tl
+\tl_set:Nn \l__chemmacros_nmr_element_default_tl { H }
+\tl_new:N \l__chemmacros_nmr_format_tl
+\tl_new:N \l__chemmacros_nmr_delta_tl
+\tl_new:N \l__chemmacros_nmr_coupling_unit_tl
+\tl_set:Nn \l__chemmacros_nmr_coupling_unit_tl { \hertz }
+\tl_new:N \l__chemmacros_nmr_list_setup_tl
+\tl_set:Nn \l__chemmacros_nmr_list_setup_tl
{
\topsep\z@skip \partopsep\z@skip
\itemsep\z@ \parsep\z@ \itemindent\z@
\leftmargin\z@
}
-\bool_new:N \l_chemmacros_nmr_frequency_bool
-\bool_new:N \l_chemmacros_nmr_solvent_bool
-\bool_new:N \l_chemmacros_nmr_delimiters_bool
-\bool_new:N \l_chemmacros_nmr_comma_bool
-\bool_new:N \l_chemmacros_nmr_inner_bool
-\bool_new:N \l_chemmacros_nmr_position_sub_bool
-\bool_new:N \l_chemmacros_nmr_parse_bool
-\bool_set_true:N \l_chemmacros_nmr_parse_bool
-\bool_new:N \l_chemmacros_nmr_list_bool
-% \bool_set_true:N \l_chemmacros_nmr_list_bool
-\bool_new:N \l_chemmacros_nmr_use_equal_bool
-% \bool_set_true:N \l_chemmacros_nmr_use_equal_bool
-\bool_new:N \l_chemmacros_nmr_custom_command_active_bool
-\bool_new:N \l_chemmacros_nmr_custom_command_used_bool
-
-\tl_new:N \l_chemmacros_nmr_unit_tl
-\tl_set:Nn \l_chemmacros_nmr_unit_tl { \mega\hertz }
+\bool_new:N \l__chemmacros_nmr_frequency_bool
+\bool_new:N \l__chemmacros_nmr_solvent_bool
+\bool_new:N \l__chemmacros_nmr_delimiters_bool
+\bool_new:N \l__chemmacros_nmr_comma_bool
+\bool_new:N \l__chemmacros_nmr_inner_bool
+\bool_new:N \l__chemmacros_nmr_position_sub_bool
+\bool_new:N \l__chemmacros_nmr_parse_bool
+\bool_set_true:N \l__chemmacros_nmr_parse_bool
+\bool_new:N \l__chemmacros_nmr_list_bool
+% \bool_set_true:N \l__chemmacros_nmr_list_bool
+\bool_new:N \l__chemmacros_nmr_use_equal_bool
+% \bool_set_true:N \l__chemmacros_nmr_use_equal_bool
+\bool_new:N \l__chemmacros_nmr_custom_command_active_bool
+\bool_new:N \l__chemmacros_nmr_custom_command_used_bool
+
+\tl_new:N \l__chemmacros_nmr_unit_tl
+\tl_set:Nn \l__chemmacros_nmr_unit_tl { \mega\hertz }
\cs_new_nopar:Npn \chemmacros_nmr_nucleus:w #1,#2 \q_stop
{
- \tl_gset:Nn \g_chemmacros_nmr_isotope_tl { #1 }
+ \tl_gset:Nn \g__chemmacros_nmr_isotope_tl { #1 }
\tl_if_in:nnTF { #2 } { [ }
{ \chemmacros_nmr_element:w #2 \q_stop }
{
- \tl_gset:No \g_chemmacros_nmr_element_tl { #2 }
- \tl_gclear:N \g_chemmacros_nmr_element_coupled_tl
+ \tl_gset:No \g__chemmacros_nmr_element_tl { #2 }
+ \tl_gclear:N \g__chemmacros_nmr_element_coupled_tl
}
}
\cs_new_nopar:Npn \chemmacros_nmr_element:w #1[#2] \q_stop
{
- \tl_gset:Nn \g_chemmacros_nmr_element_tl { #1 }
- \tl_gset:Nn \g_chemmacros_nmr_element_coupled_tl { #2 }
+ \tl_gset:Nn \g__chemmacros_nmr_element_tl { #1 }
+ \tl_gset:Nn \g__chemmacros_nmr_element_coupled_tl { #2 }
}
\cs_new:Npn \chemmacros_nmr_default_nucleus:w #1,#2 \q_stop
{
- \tl_set:Nn \l_chemmacros_nmr_isotope_default_tl { #1 }
- \tl_set:Nn \l_chemmacros_nmr_element_default_tl { #2 }
+ \tl_set:Nn \l__chemmacros_nmr_isotope_default_tl { #1 }
+ \tl_set:Nn \l__chemmacros_nmr_element_default_tl { #2 }
}
\cs_new_nopar:Npn \chemmacros_nmr_base:nn #1#2
{
- \tl_if_blank:VF \g_chemmacros_nmr_element_coupled_tl
+ \tl_if_blank:VF \g__chemmacros_nmr_element_coupled_tl
{
- \tl_put_left:Nn \g_chemmacros_nmr_element_coupled_tl { \{ }
- \tl_put_right:Nn \g_chemmacros_nmr_element_coupled_tl { \} }
+ \tl_put_left:Nn \g__chemmacros_nmr_element_coupled_tl { \{ }
+ \tl_put_right:Nn \g__chemmacros_nmr_element_coupled_tl { \} }
}
- \tl_put_left:Nn \g_chemmacros_nmr_element_coupled_tl { #2 }
- \bool_if:NTF \l_chemmacros_bpchem_bool
- { \IUPAC { \^ { #1 } \g_chemmacros_nmr_element_coupled_tl - NMR } }
+ \tl_put_left:Nn \g__chemmacros_nmr_element_coupled_tl { #2 }
+ \bool_if:NTF \l__chemmacros_bpchem_bool
+ { \IUPAC { \^ { #1 } \g__chemmacros_nmr_element_coupled_tl - NMR } }
{
\iupac { \^ { #1 } }
- \bool_if:NTF \l_chemmacros_nmr_parse_bool
+ \bool_if:NTF \l__chemmacros_nmr_parse_bool
{
- \bool_if:NTF \l_chemmacros_use_mhchem_bool
- { \exp_args:No \ce { \g_chemmacros_nmr_element_coupled_tl } }
- { \exp_args:No \ch { \g_chemmacros_nmr_element_coupled_tl } }
+ \bool_if:NTF \l__chemmacros_use_mhchem_bool
+ { \exp_args:No \ce { \g__chemmacros_nmr_element_coupled_tl } }
+ { \exp_args:No \ch { \g__chemmacros_nmr_element_coupled_tl } }
}
- { \chemmacros_atom:V \g_chemmacros_nmr_element_coupled_tl }
+ { \chemmacros_atom:V \g__chemmacros_nmr_element_coupled_tl }
- NMR
}
}
@@ -1944,40 +1944,40 @@
\cs_new_nopar:Npn \chemmacros_nmr_frequency_aux_i:w #1,#2 \q_stop
{ \SI { #1 } { #2 } }
\cs_new_nopar:Npn \chemmacros_nmr_frequency_aux_ii:n #1
- { \SI { #1 } { \tl_use:N \l_chemmacros_nmr_unit_tl } }
+ { \SI { #1 } { \tl_use:N \l__chemmacros_nmr_unit_tl } }
\keys_define:nn { chemmacros / nmr }
{
- unit .tl_set:N = \l_chemmacros_nmr_unit_tl ,
+ unit .tl_set:N = \l__chemmacros_nmr_unit_tl ,
unit .default:n = \mega\hertz ,
nucleus .code:n =
{ \chemmacros_nmr_default_nucleus:w #1 \q_stop } ,
nucleus .default:n = { 1,H } ,
- format .tl_set:N = \l_chemmacros_nmr_format_tl ,
+ format .tl_set:N = \l__chemmacros_nmr_format_tl ,
pos-number .choice: ,
pos-number / sub .code:n =
- \bool_set_true:N \l_chemmacros_nmr_position_sub_bool ,
+ \bool_set_true:N \l__chemmacros_nmr_position_sub_bool ,
pos-number / side .code:n =
- \bool_set_false:N \l_chemmacros_nmr_position_sub_bool ,
- coupling-unit .tl_set:N = \l_chemmacros_nmr_coupling_unit_tl ,
- parse .bool_set:N = \l_chemmacros_nmr_parse_bool ,
+ \bool_set_false:N \l__chemmacros_nmr_position_sub_bool ,
+ coupling-unit .tl_set:N = \l__chemmacros_nmr_coupling_unit_tl ,
+ parse .bool_set:N = \l__chemmacros_nmr_parse_bool ,
delta .code:n =
- \tl_set:Nn \l_chemmacros_nmr_delta_tl { \, #1 } ,
- list .bool_set:N = \l_chemmacros_nmr_list_bool ,
+ \tl_set:Nn \l__chemmacros_nmr_delta_tl { \, #1 } ,
+ list .bool_set:N = \l__chemmacros_nmr_list_bool ,
list .default:n = true ,
- list-setup .tl_set:N = \l_chemmacros_nmr_list_setup_tl ,
- use-equal .bool_set:N = \l_chemmacros_nmr_use_equal_bool ,
+ list-setup .tl_set:N = \l__chemmacros_nmr_list_setup_tl ,
+ use-equal .bool_set:N = \l__chemmacros_nmr_use_equal_bool ,
use-equal .default:n = true
}
-\prop_new:N \l_chemmacros_nmr_prop
+\prop_new:N \l__chemmacros_nmr_prop
\NewDocumentCommand \DeclareChemNMR { mm }
{
- \prop_if_in:NnTF \l_chemmacros_nmr_prop { #1 }
+ \prop_if_in:NnTF \l__chemmacros_nmr_prop { #1 }
{ \chemmacros_msg:nnxx { chemmacros } { declare-nmr } { #1 } { } }
{
- \prop_put:Nnn \l_chemmacros_nmr_prop { #1 } { #2 }
+ \prop_put:Nnn \l__chemmacros_nmr_prop { #1 } { #2 }
\NewDocumentCommand #1 { s }
{ \IfBooleanTF {##1} { \NMR*{#2} } { \NMR{#2} } }
}
@@ -1985,9 +1985,9 @@
\NewDocumentCommand \RenewChemNMR { mm }
{
- \prop_if_in:NnTF \l_chemmacros_nmr_prop { #1 }
+ \prop_if_in:NnTF \l__chemmacros_nmr_prop { #1 }
{
- \prop_put:Nnn \l_chemmacros_nmr_prop { #1 } { #2 }
+ \prop_put:Nnn \l__chemmacros_nmr_prop { #1 } { #2 }
\NewDocumentCommand #1 { s }
{ \IfBooleanTF {##1} { \NMR*{#2} } { \NMR{#2} } }
}
@@ -2000,34 +2000,34 @@
% \NMR* same but without ": $\delta$" at end
\NewDocumentCommand \NMR { s g d() o }
{
- \bool_if:NT \l_chemmacros_nmr_list_bool { \item \scan_stop: }
+ \bool_if:NT \l__chemmacros_nmr_list_bool { \item \scan_stop: }
\group_begin:
\chemmacros_leave_vmode:
- \bool_set_false:N \l_chemmacros_nmr_frequency_bool
- \bool_set_false:N \l_chemmacros_nmr_solvent_bool
+ \bool_set_false:N \l__chemmacros_nmr_frequency_bool
+ \bool_set_false:N \l__chemmacros_nmr_solvent_bool
\IfNoValueF { #3 }
- { \bool_set_true:N \l_chemmacros_nmr_frequency_bool }
+ { \bool_set_true:N \l__chemmacros_nmr_frequency_bool }
\IfNoValueF { #4 }
- { \bool_set_true:N \l_chemmacros_nmr_solvent_bool }
+ { \bool_set_true:N \l__chemmacros_nmr_solvent_bool }
\bool_if:nT
{
- \l_chemmacros_nmr_frequency_bool
+ \l__chemmacros_nmr_frequency_bool
||
- \l_chemmacros_nmr_solvent_bool
+ \l__chemmacros_nmr_solvent_bool
}
- { \bool_set_true:N \l_chemmacros_nmr_delimiters_bool }
+ { \bool_set_true:N \l__chemmacros_nmr_delimiters_bool }
\bool_if:nT
{
- \l_chemmacros_nmr_frequency_bool
+ \l__chemmacros_nmr_frequency_bool
&&
- \l_chemmacros_nmr_solvent_bool
+ \l__chemmacros_nmr_solvent_bool
}
- { \bool_set_true:N \l_chemmacros_nmr_comma_bool }
+ { \bool_set_true:N \l__chemmacros_nmr_comma_bool }
\IfNoValueTF { #2 }
{
\chemmacros_nmr_nucleus:w
- \l_chemmacros_nmr_isotope_default_tl ,
- \l_chemmacros_nmr_element_default_tl \q_stop
+ \l__chemmacros_nmr_isotope_default_tl ,
+ \l__chemmacros_nmr_element_default_tl \q_stop
}
{ \chemmacros_nmr_nucleus:w #2 \q_stop }
\mode_if_math:TF
@@ -2035,19 +2035,19 @@
\text
{
\group_begin:
- \tl_use:N \l_chemmacros_nmr_format_tl
+ \tl_use:N \l__chemmacros_nmr_format_tl
\chemmacros_nmr_base:VV
- \g_chemmacros_nmr_isotope_tl
- \g_chemmacros_nmr_element_tl
- \bool_if:NT \l_chemmacros_nmr_delimiters_bool
+ \g__chemmacros_nmr_isotope_tl
+ \g__chemmacros_nmr_element_tl
+ \bool_if:NT \l__chemmacros_nmr_delimiters_bool
{ ~ ( }
- \bool_if:NT \l_chemmacros_nmr_frequency_bool
+ \bool_if:NT \l__chemmacros_nmr_frequency_bool
{ \chemmacros_nmr_frequency:n { #3 } }
- \bool_if:NT \l_chemmacros_nmr_comma_bool
+ \bool_if:NT \l__chemmacros_nmr_comma_bool
{ , ~ }
- \bool_if:NT \l_chemmacros_nmr_solvent_bool
+ \bool_if:NT \l__chemmacros_nmr_solvent_bool
{ \chemmacros_atom:n { #4 } }
- \bool_if:NT \l_chemmacros_nmr_delimiters_bool
+ \bool_if:NT \l__chemmacros_nmr_delimiters_bool
{ ) }
\IfBooleanF { #1 } { : ~ }
\group_end:
@@ -2055,43 +2055,43 @@
\IfBooleanF { #1 }
{
\delta
- \text { \l_chemmacros_nmr_delta_tl }
- \bool_if:NT \l_chemmacros_nmr_use_equal_bool { = }
+ \text { \l__chemmacros_nmr_delta_tl }
+ \bool_if:NT \l__chemmacros_nmr_use_equal_bool { = }
}
}
{
\group_begin:
- \tl_use:N \l_chemmacros_nmr_format_tl
+ \tl_use:N \l__chemmacros_nmr_format_tl
\chemmacros_nmr_base:VV
- \g_chemmacros_nmr_isotope_tl
- \g_chemmacros_nmr_element_tl
- \bool_if:NT \l_chemmacros_nmr_delimiters_bool
+ \g__chemmacros_nmr_isotope_tl
+ \g__chemmacros_nmr_element_tl
+ \bool_if:NT \l__chemmacros_nmr_delimiters_bool
{ ~ ( }
- \bool_if:NT \l_chemmacros_nmr_frequency_bool
+ \bool_if:NT \l__chemmacros_nmr_frequency_bool
{ \chemmacros_nmr_frequency:n { #3 } }
- \bool_if:NT \l_chemmacros_nmr_comma_bool
+ \bool_if:NT \l__chemmacros_nmr_comma_bool
{ , ~ }
- \bool_if:NT \l_chemmacros_nmr_solvent_bool
+ \bool_if:NT \l__chemmacros_nmr_solvent_bool
{
- \bool_if:NTF \l_chemmacros_nmr_parse_bool
+ \bool_if:NTF \l__chemmacros_nmr_parse_bool
{
- \bool_if:NTF \l_chemmacros_use_mhchem_bool
+ \bool_if:NTF \l__chemmacros_use_mhchem_bool
{ \ce { #4 } }
{ \ch { #4 } }
}
{ #4 }
}
- \bool_if:NT \l_chemmacros_nmr_delimiters_bool
+ \bool_if:NT \l__chemmacros_nmr_delimiters_bool
{ ) }
\IfBooleanF { #1 } { : }
\group_end:
\IfBooleanF { #1 }
{
\tl_use:N \c_space_tl $ \delta $
- \l_chemmacros_nmr_delta_tl
- \bool_if:NT \l_chemmacros_nmr_use_equal_bool { ~ = }
+ \l__chemmacros_nmr_delta_tl
+ \bool_if:NT \l__chemmacros_nmr_use_equal_bool { ~ = }
}
- \bool_if:NF \l_chemmacros_nmr_comma_bool
+ \bool_if:NF \l__chemmacros_nmr_comma_bool
{ \IfBooleanF { #1 } { \chemmacros_xspace: } }
}
\group_end:
@@ -2100,13 +2100,13 @@
\NewDocumentCommand \chemmacros_data:w { smo }
{
- \bool_if:NT \l_chemmacros_nmr_list_bool { \item }
+ \bool_if:NT \l__chemmacros_nmr_list_bool { \item }
{
- \tl_use:N \l_chemmacros_nmr_format_tl #2
+ \tl_use:N \l__chemmacros_nmr_format_tl #2
\IfNoValueF { #3 } { ~ ( #3 ) }
- \IfBooleanT { #1 } { \bool_if:NT \l_chemmacros_nmr_use_equal_bool { : } }
+ \IfBooleanT { #1 } { \bool_if:NT \l__chemmacros_nmr_use_equal_bool { : } }
}
- \IfBooleanF { #1 } { \bool_if:NT \l_chemmacros_nmr_use_equal_bool { ~ = } }
+ \IfBooleanF { #1 } { \bool_if:NT \l__chemmacros_nmr_use_equal_bool { ~ = } }
}
\cs_new_protected_nopar:Npn \chemmacros_val:n #1
@@ -2122,17 +2122,17 @@
{
\group_begin:
\IfNoValueF { #1 } { \keys_set:nn { chemmacros / nmr } { #1 } }
- \bool_set_true:N \l_chemmacros_nmr_inner_bool
+ \bool_set_true:N \l__chemmacros_nmr_inner_bool
\cs_set_eq:NN \# \chemmacros_nmr_number:n
\cs_set_eq:NN \pos \chemmacros_nmr_position:n
\cs_set_eq:NN \J \chemmacros_nmr_coupling:w
\cs_set_eq:NN \data \chemmacros_data:w
\cs_set_eq:NN \val \chemmacros_val:n
- \bool_if:NT \l_chemmacros_nmr_list_bool
- { \list {} { \l_chemmacros_nmr_list_setup_tl } }
+ \bool_if:NT \l__chemmacros_nmr_list_bool
+ { \list {} { \l__chemmacros_nmr_list_setup_tl } }
}
{
- \bool_if:NT \l_chemmacros_nmr_list_bool
+ \bool_if:NT \l__chemmacros_nmr_list_bool
{ \endlist }
\group_end:
\chemmacros_ignore_spaces:
@@ -2141,33 +2141,33 @@
\cs_new:Npn \chemmacros_nmr_number:n #1
{
#1 \,
- \bool_if:NTF \l_chemmacros_bpchem_bool
- { \g_chemmacros_nmr_element_tl }
- { \chemmacros_atom:V \g_chemmacros_nmr_element_tl }
+ \bool_if:NTF \l__chemmacros_bpchem_bool
+ { \g__chemmacros_nmr_element_tl }
+ { \chemmacros_atom:V \g__chemmacros_nmr_element_tl }
}
\cs_new:Npn \chemmacros_nmr_position:n #1
{
- \bool_if:NTF \l_chemmacros_bpchem_bool
+ \bool_if:NTF \l__chemmacros_bpchem_bool
{
- \tl_use:N \g_chemmacros_nmr_element_tl
- \bool_if:NTF \l_chemmacros_nmr_position_sub_bool
+ \tl_use:N \g__chemmacros_nmr_element_tl
+ \bool_if:NTF \l__chemmacros_nmr_position_sub_bool
{ $\sb{#1}$ }
{ - #1 }
}
{
- \bool_if:NTF \l_chemmacros_nmr_position_sub_bool
+ \bool_if:NTF \l__chemmacros_nmr_position_sub_bool
{
- \chemmacros_chemformula:x { \g_chemmacros_nmr_element_tl _ #1 }
+ \chemmacros_chemformula:x { \g__chemmacros_nmr_element_tl _ #1 }
}
- { \chemmacros_atom:V \g_chemmacros_nmr_element_tl - #1 }
+ { \chemmacros_atom:V \g__chemmacros_nmr_element_tl - #1 }
}
}
\cs_new:Npn \chemmacros_nmr_coupling:w
{
- \tl_clear:N \l_chemmacros_nmr_coupling_nuclei_tl
- \tl_clear:N \l_chemmacros_nmr_coupling_bonds_tl
+ \tl_clear:N \l__chemmacros_nmr_coupling_nuclei_tl
+ \tl_clear:N \l__chemmacros_nmr_coupling_bonds_tl
\peek_meaning:NTF (
{ \chemmacros_nmr_coupling_auxi:w }
{ \chemmacros_nmr_coupling_auxii:w }
@@ -2175,10 +2175,10 @@
\cs_new:Npn \chemmacros_nmr_coupling_auxi:w (#1;#2)
{
- \tl_set:Nn \l_chemmacros_nmr_coupling_bonds_tl { #1 }
- \tl_set:Nn \l_chemmacros_nmr_coupling_nuclei_tl { #2 }
- \tl_put_right:Nn \l_chemmacros_nmr_coupling_nuclei_tl { ) }
- \tl_put_left:Nn \l_chemmacros_nmr_coupling_nuclei_tl { ( }
+ \tl_set:Nn \l__chemmacros_nmr_coupling_bonds_tl { #1 }
+ \tl_set:Nn \l__chemmacros_nmr_coupling_nuclei_tl { #2 }
+ \tl_put_right:Nn \l__chemmacros_nmr_coupling_nuclei_tl { ) }
+ \tl_put_left:Nn \l__chemmacros_nmr_coupling_nuclei_tl { ( }
\chemmacros_nmr_coupling_auxii:w
}
@@ -2199,8 +2199,8 @@
list-units=single
}
\(
- ^{ \l_chemmacros_nmr_coupling_bonds_tl } J
- \l_chemmacros_nmr_coupling_nuclei_tl = \SIlist{#2}{#1}
+ ^{ \l__chemmacros_nmr_coupling_bonds_tl } J
+ \l__chemmacros_nmr_coupling_nuclei_tl = \SIlist{#2}{#1}
\)
\group_end:
}
@@ -2215,9 +2215,9 @@
list-units=single
}
\(
- ^{ \l_chemmacros_nmr_coupling_bonds_tl } J
- \l_chemmacros_nmr_coupling_nuclei_tl
- = \exp_args:Nno \SIlist { #1 } { \l_chemmacros_nmr_coupling_unit_tl }
+ ^{ \l__chemmacros_nmr_coupling_bonds_tl } J
+ \l__chemmacros_nmr_coupling_nuclei_tl
+ = \exp_args:Nno \SIlist { #1 } { \l__chemmacros_nmr_coupling_unit_tl }
\)
\group_end:
}
@@ -2228,35 +2228,35 @@
{ \settowidth { #1 } { #2 } }
\cs_generate_variant:Nn \dim_to_width:nn { Nn }
-\bool_new:N \l_chemmacros_mhname_width_bool
-\bool_set_false:N \l_chemmacros_mhname_width_bool
-\dim_new:N \l_chemmacros_mhname_width_dim
+\bool_new:N \l__chemmacros_mhname_width_bool
+\bool_set_false:N \l__chemmacros_mhname_width_bool
+\dim_new:N \l__chemmacros_mhname_width_dim
-\tl_new:N \l_chemmacros_mhname_align_tl
-\tl_set:Nn \l_chemmacros_mhname_align_tl { \centering }
+\tl_new:N \l__chemmacros_mhname_align_tl
+\tl_set:Nn \l__chemmacros_mhname_align_tl { \centering }
-\tl_new:N \l_chemmacros_mhname_format_tl
-\tl_new:N \l_chemmacros_mhname_fontsize_tl
-\tl_set:Nn \l_chemmacros_mhname_fontsize_tl { \tiny }
+\tl_new:N \l__chemmacros_mhname_format_tl
+\tl_new:N \l__chemmacros_mhname_fontsize_tl
+\tl_set:Nn \l__chemmacros_mhname_fontsize_tl { \tiny }
\keys_define:nn { chemmacros / mhName }
{
- align .tl_set:N = \l_chemmacros_mhname_align_tl ,
- format .tl_set:N = \l_chemmacros_mhname_format_tl ,
- fontsize .tl_set:N = \l_chemmacros_mhname_fontsize_tl ,
+ align .tl_set:N = \l__chemmacros_mhname_align_tl ,
+ format .tl_set:N = \l__chemmacros_mhname_format_tl ,
+ fontsize .tl_set:N = \l__chemmacros_mhname_fontsize_tl ,
width .code:n =
{
\tl_if_eq:nnTF { #1 } { auto }
- { \bool_set_false:N \l_chemmacros_mhname_width_bool }
+ { \bool_set_false:N \l__chemmacros_mhname_width_bool }
{
- \bool_set_true:N \l_chemmacros_mhname_width_bool
- \dim_set:Nn \l_chemmacros_mhname_width_dim { #1 }
+ \bool_set_true:N \l__chemmacros_mhname_width_bool
+ \dim_set:Nn \l__chemmacros_mhname_width_dim { #1 }
}
}
}
% \mhName[<keyval>]{<chemformula>}{<text>}
-\bool_if:nF { \l_chemmacros_version_one_bool || \l_chemmacros_use_mhchem_bool }
+\bool_if:nF { \l__chemmacros_version_one_bool || \l__chemmacros_use_mhchem_bool }
{
\NewDocumentCommand \mhName { o m m }
{
@@ -2266,14 +2266,14 @@
{
\underset
{
- \bool_if:NF \l_chemmacros_mhname_width_bool
- { \dim_to_width:Nn \l_chemmacros_mhname_width_dim { #2 } }
+ \bool_if:NF \l__chemmacros_mhname_width_bool
+ { \dim_to_width:Nn \l__chemmacros_mhname_width_dim { #2 } }
\parbox
- { \dim_use:N \l_chemmacros_mhname_width_dim }
+ { \dim_use:N \l__chemmacros_mhname_width_dim }
{
- \tl_use:N \l_chemmacros_mhname_align_tl
- \tl_use:N \l_chemmacros_mhname_format_tl
- \tl_use:N \l_chemmacros_mhname_fontsize_tl
+ \tl_use:N \l__chemmacros_mhname_align_tl
+ \tl_use:N \l__chemmacros_mhname_format_tl
+ \tl_use:N \l__chemmacros_mhname_fontsize_tl
#3
}
}
@@ -2285,57 +2285,57 @@
% --------------------------------------------------------------------------- %
% - phases
-\bool_new:N \l_chemmacros_phases_sub_bool
-\dim_new:N \l_chemmacros_phases_space_dim
-\dim_set:Nn \l_chemmacros_phases_space_dim { .1333 em }
+\bool_new:N \l__chemmacros_phases_sub_bool
+\dim_new:N \l__chemmacros_phases_space_dim
+\dim_set:Nn \l__chemmacros_phases_space_dim { .1333 em }
\keys_define:nn { chemmacros / phases }
{
pos .choice: ,
- pos / sub .code:n = \bool_set_true:N \l_chemmacros_phases_sub_bool ,
- pos / side .code:n = \bool_set_false:N \l_chemmacros_phases_sub_bool ,
- space .dim_set:N = \l_chemmacros_phases_space_dim
+ pos / sub .code:n = \bool_set_true:N \l__chemmacros_phases_sub_bool ,
+ pos / side .code:n = \bool_set_false:N \l__chemmacros_phases_sub_bool ,
+ space .dim_set:N = \l__chemmacros_phases_space_dim
}
-\prop_new:N \l_chemmacros_phases_prop
-\prop_new:N \l_chemmacros_phases_german_prop
+\prop_new:N \l__chemmacros_phases_prop
+\prop_new:N \l__chemmacros_phases_german_prop
\NewDocumentCommand \DeclareChemPhase { mom }
{
- \tl_set_rescan:Nnn \l_chemmacros_tmpa_tl { \char_set_catcode_letter:N \\ } { #1 }
- \tl_set:Nf \l_chemmacros_tmpa_tl { \tl_tail:V \l_chemmacros_tmpa_tl }
+ \tl_set_rescan:Nnn \l__chemmacros_tmpa_tl { \char_set_catcode_letter:N \\ } { #1 }
+ \tl_set:Nf \l__chemmacros_tmpa_tl { \tl_tail:V \l__chemmacros_tmpa_tl }
\cs_if_free:NTF #1
{ \cs_new_nopar:Npn #1 {} }
{ \chemmacros_msg:nnxx { chemmacros } { declare-phase } { #1 } {} }
\IfNoValueTF { #2 }
- { \prop_put:Non \l_chemmacros_phases_german_prop { \l_chemmacros_tmpa_tl } { #3 } }
- { \prop_put:Non \l_chemmacros_phases_german_prop { \l_chemmacros_tmpa_tl } { #2 } }
- \prop_put:Non \l_chemmacros_phases_prop { \l_chemmacros_tmpa_tl } { #3 }
+ { \prop_put:Non \l__chemmacros_phases_german_prop { \l__chemmacros_tmpa_tl } { #3 } }
+ { \prop_put:Non \l__chemmacros_phases_german_prop { \l__chemmacros_tmpa_tl } { #2 } }
+ \prop_put:Non \l__chemmacros_phases_prop { \l__chemmacros_tmpa_tl } { #3 }
\chemmacros_make_phases:
}
\NewDocumentCommand \RenewChemPhase { mom }
{
- \tl_set_rescan:Nnn \l_chemmacros_tmpa_tl { \char_set_catcode_letter:N \\ } { #1 }
- \tl_set:Nf \l_chemmacros_tmpa_tl { \tl_tail:V \l_chemmacros_tmpa_tl }
+ \tl_set_rescan:Nnn \l__chemmacros_tmpa_tl { \char_set_catcode_letter:N \\ } { #1 }
+ \tl_set:Nf \l__chemmacros_tmpa_tl { \tl_tail:V \l__chemmacros_tmpa_tl }
\cs_if_free:NT #1
{ \chemmacros_msg:nnxx { chemmacros } { renew-phase } { #1 } {} }
\IfNoValueTF { #2 }
- { \prop_put:Non \l_chemmacros_phases_german_prop { \l_chemmacros_tmpa_tl } { #3 } }
- { \prop_put:Non \l_chemmacros_phases_german_prop { \l_chemmacros_tmpa_tl } { #2 } }
- \prop_put:Non \l_chemmacros_phases_prop { \l_chemmacros_tmpa_tl } { #3 }
+ { \prop_put:Non \l__chemmacros_phases_german_prop { \l__chemmacros_tmpa_tl } { #3 } }
+ { \prop_put:Non \l__chemmacros_phases_german_prop { \l__chemmacros_tmpa_tl } { #2 } }
+ \prop_put:Non \l__chemmacros_phases_prop { \l__chemmacros_tmpa_tl } { #3 }
\chemmacros_make_phases:
}
\cs_new_nopar:Npn \chemmacros_make_phases:
{
- \bool_if:NTF \l_chemmacros_german_bool
+ \bool_if:NTF \l__chemmacros_german_bool
{
- \prop_map_function:NN \l_chemmacros_phases_german_prop
+ \prop_map_function:NN \l__chemmacros_phases_german_prop
\chemmacros_define_phases:nn
}
{
- \prop_map_function:NN \l_chemmacros_phases_prop
+ \prop_map_function:NN \l__chemmacros_phases_prop
\chemmacros_define_phases:nn
}
}
@@ -2344,16 +2344,16 @@
{
\cs_set_nopar:cpn { #1 }
{
- \bool_if:NTF \l_chemmacros_phases_sub_bool
+ \bool_if:NTF \l__chemmacros_phases_sub_bool
{
- \bool_if:NTF \l_chemformula_inside_ch_bool
+ \bool_if:NTF \l__chemformula_inside_ch_bool
{ \chemformula_subscript:n { ( #2 ) } }
{ \ensuremath { \c_math_subscript_token { \text { (#2) } } } }
}
{
\ensuremath
{
- \skip_horizontal:N \l_chemmacros_phases_space_dim
+ \skip_horizontal:N \l__chemmacros_phases_space_dim
\text { (#2) }
}
}
@@ -2367,18 +2367,18 @@
\NewDocumentCommand \phase { m }
{
- \bool_if:NTF \l_chemmacros_phases_sub_bool
+ \bool_if:NTF \l__chemmacros_phases_sub_bool
{ \ensuremath { \c_math_subscript_token { \text { (#1) } } } }
{
\ensuremath
{
- \skip_horizontal:N \l_chemmacros_phases_space_dim
+ \skip_horizontal:N \l__chemmacros_phases_space_dim
\text { (#1) }
}
}
}
-\bool_if:NT \l_chemmacros_version_one_bool
+\bool_if:NT \l__chemmacros_version_one_bool
{
\cs_new_eq:NN \solid \sld
\cs_new_eq:NN \liquid \lqd
@@ -2402,45 +2402,45 @@
{
\addcontentsline { lor } { reaction }
{
- \l_chemmacros_reaction_lorname_tl #3 #2 ##1 #4
- \tl_use:N \g_chemmacros_reaction_description_tl
+ \l__chemmacros_reaction_lorname_tl #3 #2 ##1 #4
+ \tl_use:N \g__chemmacros_reaction_description_tl
}
- \tl_gclear:N \g_chemmacros_reaction_description_tl
+ \tl_gclear:N \g__chemmacros_reaction_description_tl
}
}
}
}
-\tl_new:N \g_chemmacros_reaction_description_tl
+\tl_new:N \g__chemmacros_reaction_description_tl
\NewDocumentCommand \AddRxnDesc { m }
{
\tl_if_blank:nF { #1 }
- { \tl_gset:Nn \g_chemmacros_reaction_description_tl { : ~ #1 } }
+ { \tl_gset:Nn \g__chemmacros_reaction_description_tl { : ~ #1 } }
}
% define \listofreactions
-\tl_new:N \l_chemmacros_reaction_lorname_tl
-\tl_set:Nn \l_chemmacros_reaction_lorname_tl { Reaction ~ }
+\tl_new:N \l__chemmacros_reaction_lorname_tl
+\tl_set:Nn \l__chemmacros_reaction_lorname_tl { Reaction ~ }
\tl_new:N \reactionlistname
\tl_set:Nn \reactionlistname { List~of~reactions }
% language settings
\AtBeginDocument
{
- \bool_if:NT \l_chemmacros_german_bool
+ \bool_if:NT \l__chemmacros_german_bool
{
\tl_set:Nn \reactionlistname { Reaktionsverzeichnis }
- \tl_set:Nn \l_chemmacros_reaction_lorname_tl { Reaktion ~ }
+ \tl_set:Nn \l__chemmacros_reaction_lorname_tl { Reaktion ~ }
}
- \bool_if:NT \l_chemmacros_italian_bool
+ \bool_if:NT \l__chemmacros_italian_bool
{
\tl_set:Nn \reactionlistname { Elenco ~ delle ~ reazioni }
- \tl_set:Nn \l_chemmacros_reaction_lorname_tl { Reazione ~ }
+ \tl_set:Nn \l__chemmacros_reaction_lorname_tl { Reazione ~ }
}
- \bool_if:NT \l_chemmacros_french_bool
+ \bool_if:NT \l__chemmacros_french_bool
{
\tl_set:Nn \reactionlistname { Table ~ des ~ r\'eactions }
- \tl_set:Nn \l_chemmacros_reaction_lorname_tl { R\'eaction ~ }
+ \tl_set:Nn \l__chemmacros_reaction_lorname_tl { R\'eaction ~ }
}
}
@@ -2451,7 +2451,7 @@
{ \@dottedtocline { 1 } { 1.5em } { 2.3em } { #1 } { #2 } }
% create tagform
-\bool_if:NTF \l_chemmacros_version_one_bool
+\bool_if:NTF \l__chemmacros_version_one_bool
{ \newtagform { CMreaction } { \{ } { \} } }
{ \newtagform { reaction } { \{ } { \} } }
\newcounter { chemmacros_save_reaction }
@@ -2461,17 +2461,17 @@
\cs_new_nopar:Npn \chemmacros_begin_reaction:
{
% create individual names for `hyperref':
- \bool_if:NT \l_chemmacros_hyperref_bool
+ \bool_if:NT \l__chemmacros_hyperref_bool
{
\cs_set_nopar:Npn \theHequation
{ R . \theHsection . \arabic { reaction } }
}
% enable labelformat `reaction':
- \bool_if:NT \l_chemmacros_varioref_bool
+ \bool_if:NT \l__chemmacros_varioref_bool
{ \cs_set_eq:NN \p@equation \p@reaction }
\setcounter { chemmacros_save_reaction } { \value { equation } }
\setcounter { equation } { \value { reaction } }
- \bool_if:NTF \l_chemmacros_version_one_bool
+ \bool_if:NTF \l__chemmacros_version_one_bool
{ \usetagform { CMreaction } }
{ \usetagform { reaction } }
}
@@ -2484,22 +2484,22 @@
}
% --------------------------------------------------------------------------- %
-\bool_new:N \l_chemmacros_reactions_star_bool
-\bool_new:N \l_chemmacros_reactions_args_bool
+\bool_new:N \l__chemmacros_reactions_star_bool
+\bool_new:N \l__chemmacros_reactions_args_bool
\keys_define:nn { chemmacros / reaction }
{
- star .bool_set:N = \l_chemmacros_reactions_star_bool ,
+ star .bool_set:N = \l__chemmacros_reactions_star_bool ,
star .default:n = true ,
- arg .bool_set:N = \l_chemmacros_reactions_args_bool ,
+ arg .bool_set:N = \l__chemmacros_reactions_args_bool ,
arg .default:n = true ,
list-name .tl_set:N = \reactionlistname ,
list-entry .code:n =
- \tl_set:Nn \l_chemmacros_reaction_lorname_tl { #1 ~ }
+ \tl_set:Nn \l__chemmacros_reaction_lorname_tl { #1 ~ }
}
% \DeclareChemReaction[<keyval>]{<name>}{<type>}
-\bool_if:NF \l_chemmacros_version_one_bool
+\bool_if:NF \l__chemmacros_version_one_bool
{
\NewDocumentCommand \DeclareChemReaction { o m m }
{
@@ -2508,11 +2508,11 @@
{
\IfNoValueTF { #1 }
{
- \bool_set_false:N \l_chemmacros_reactions_star_bool
- \bool_set_false:N \l_chemmacros_reactions_args_bool
+ \bool_set_false:N \l__chemmacros_reactions_star_bool
+ \bool_set_false:N \l__chemmacros_reactions_args_bool
}
{ \keys_set:nn { chemmacros / reaction } { #1 } }
- \bool_if:NTF \l_chemmacros_reactions_args_bool
+ \bool_if:NTF \l__chemmacros_reactions_args_bool
{
\NewEnviron { #2 } [ 2 ] []
{
@@ -2523,7 +2523,7 @@
\end{ #3 }
\chemmacros_end_reaction:
}
- \bool_if:NT \l_chemmacros_reactions_star_bool
+ \bool_if:NT \l__chemmacros_reactions_star_bool
{
\NewEnviron { #2* } [ 1 ]
{
@@ -2543,7 +2543,7 @@
\end { #3 }
\chemmacros_end_reaction:
}
- \bool_if:NT \l_chemmacros_reactions_star_bool
+ \bool_if:NT \l__chemmacros_reactions_star_bool
{
\NewEnviron { #2* }
{
@@ -2566,14 +2566,14 @@
\cs_new:Npn \chemmacros_equation_chemformula:n #1
{
- \bool_if:NTF \l_chemmacros_use_mhchem_bool
+ \bool_if:NTF \l__chemmacros_use_mhchem_bool
{ \cee { #1 } }
{ \ch { #1 } }
}
\cs_generate_variant:Nn \chemmacros_equation_chemformula:n { o }
% predefined:
-\bool_if:NF \l_chemmacros_version_one_bool
+\bool_if:NF \l__chemmacros_version_one_bool
{
\DeclareChemReaction [ star ] { reaction } { equation }
\DeclareChemReaction [ star ] { reactions } { align }
@@ -2606,37 +2606,37 @@
% --------------------------------------------------------------------------- %
% \State
-\tl_new:N \l_chemmacros_State_delta_tl
-\tl_set:Nn \l_chemmacros_State_delta_tl { \Delta }
-\bool_new:N \l_chemmacros_State_delta_bool
-\bool_set_true:N \l_chemmacros_State_delta_bool
-\bool_new:N \l_chemmacros_State_subscript_left_bool
-\bool_set_true:N \l_chemmacros_State_subscript_left_bool
-\bool_new:N \l_chemmacros_State_exponent_bool
-\bool_set_true:N \l_chemmacros_State_exponent_bool
-\tl_new:N \l_chemmacros_State_exponent_tl
-\tl_set:Nn \l_chemmacros_State_exponent_tl { \standardstate }
+\tl_new:N \l__chemmacros_State_delta_tl
+\tl_set:Nn \l__chemmacros_State_delta_tl { \Delta }
+\bool_new:N \l__chemmacros_State_delta_bool
+\bool_set_true:N \l__chemmacros_State_delta_bool
+\bool_new:N \l__chemmacros_State_subscript_left_bool
+\bool_set_true:N \l__chemmacros_State_subscript_left_bool
+\bool_new:N \l__chemmacros_State_exponent_bool
+\bool_set_true:N \l__chemmacros_State_exponent_bool
+\tl_new:N \l__chemmacros_State_exponent_tl
+\tl_set:Nn \l__chemmacros_State_exponent_tl { \standardstate }
\keys_define:nn { chemmacros / state }
{
delta .code:n =
{
\exp_args:Nf \tl_if_eq:nnTF { #1 } { false }
- { \bool_set_false:N \l_chemmacros_State_delta_bool }
+ { \bool_set_false:N \l__chemmacros_State_delta_bool }
{
- \bool_set_true:N \l_chemmacros_State_delta_bool
- \tl_set:Nn \l_chemmacros_State_delta_tl { #1 }
+ \bool_set_true:N \l__chemmacros_State_delta_bool
+ \tl_set:Nn \l__chemmacros_State_delta_tl { #1 }
}
} ,
- subscript-left .bool_set:N = \l_chemmacros_State_subscript_left_bool ,
+ subscript-left .bool_set:N = \l__chemmacros_State_subscript_left_bool ,
subscript-left .default:n = true ,
exponent .code:n =
{
\exp_args:Nf \tl_if_eq:nnTF { #1 } { false }
- { \bool_set_false:N \l_chemmacros_State_exponent_bool }
+ { \bool_set_false:N \l__chemmacros_State_exponent_bool }
{
- \bool_set_true:N \l_chemmacros_State_exponent_bool
- \tl_set:Nn \l_chemmacros_State_exponent_tl { #1 }
+ \bool_set_true:N \l__chemmacros_State_exponent_bool
+ \tl_set:Nn \l__chemmacros_State_exponent_tl { #1 }
}
} ,
exponent .default:n = \standardstate
@@ -2654,21 +2654,21 @@
{ \keys_set:nn { chemmacros / state } { #1 } }
\ensuremath
{
- \bool_if:NT \l_chemmacros_State_delta_bool
- { \tl_use:N \l_chemmacros_State_delta_tl }
- \bool_if:NT \l_chemmacros_State_subscript_left_bool
+ \bool_if:NT \l__chemmacros_State_delta_bool
+ { \tl_use:N \l__chemmacros_State_delta_tl }
+ \bool_if:NT \l__chemmacros_State_subscript_left_bool
{ \c_math_subscript_token { \text { #3 } } }
#2
- \bool_if:NF \l_chemmacros_State_subscript_left_bool
+ \bool_if:NF \l__chemmacros_State_subscript_left_bool
{ \c_math_subscript_token { \text { #3 } } }
- \bool_if:NT \l_chemmacros_State_exponent_bool
- { ^ { \tl_use:N \l_chemmacros_State_exponent_tl } }
+ \bool_if:NT \l__chemmacros_State_exponent_bool
+ { ^ { \tl_use:N \l__chemmacros_State_exponent_tl } }
}
\group_end:
}
\cs_generate_variant:Nn \chemmacros_state:nnn { fnn,xnn }
-\bool_if:NF \l_chemmacros_version_one_bool
+\bool_if:NF \l__chemmacros_version_one_bool
{
\NewDocumentCommand \State { s o m G{} }
{
@@ -2684,52 +2684,52 @@
}
% --------------------------------------------------------------------------- %
-\tl_new:N \l_chemmacros_thermod_subscript_left_tl
-\tl_new:N \l_chemmacros_thermod_subscript_left_default_tl
-\tl_new:N \l_chemmacros_thermod_subscript_tl
-\tl_new:N \l_chemmacros_thermod_subscript_default_tl
+\tl_new:N \l__chemmacros_thermod_subscript_left_tl
+\tl_new:N \l__chemmacros_thermod_subscript_left_default_tl
+\tl_new:N \l__chemmacros_thermod_subscript_tl
+\tl_new:N \l__chemmacros_thermod_subscript_default_tl
-\tl_new:N \l_chemmacros_thermod_unit_tl
+\tl_new:N \l__chemmacros_thermod_unit_tl
-\tl_new:N \l_chemmacros_thermod_exponent_tl
-\tl_new:N \l_chemmacros_thermod_exponent_default_tl
-\tl_set:Nn \l_chemmacros_thermod_exponent_default_tl { \standardstate }
+\tl_new:N \l__chemmacros_thermod_exponent_tl
+\tl_new:N \l__chemmacros_thermod_exponent_default_tl
+\tl_set:Nn \l__chemmacros_thermod_exponent_default_tl { \standardstate }
-\tl_new:N \l_chemmacros_thermod_delta_tl
-\tl_new:N \l_chemmacros_thermod_delta_default_tl
-\tl_set:Nn \l_chemmacros_thermod_delta_default_tl { \Delta }
+\tl_new:N \l__chemmacros_thermod_delta_tl
+\tl_new:N \l__chemmacros_thermod_delta_default_tl
+\tl_set:Nn \l__chemmacros_thermod_delta_default_tl { \Delta }
-\bool_new:N \l_chemmacros_renewstate_bool
+\bool_new:N \l__chemmacros_renewstate_bool
\keys_define:nn { chemmacros }
{
State / subscript .choice: ,
State / subscript / left .code:n =
- { \tl_set:Nn \l_chemmacros_thermod_subscript_left_tl { true } } ,
+ { \tl_set:Nn \l__chemmacros_thermod_subscript_left_tl { true } } ,
State / subscript / right .code:n =
- { \tl_set:Nn \l_chemmacros_thermod_subscript_left_tl { false } } ,
+ { \tl_set:Nn \l__chemmacros_thermod_subscript_left_tl { false } } ,
State / exponent .tl_set:N =
- \l_chemmacros_thermod_exponent_tl ,
+ \l__chemmacros_thermod_exponent_tl ,
State / delta .tl_set:N =
- \l_chemmacros_thermod_delta_tl ,
+ \l__chemmacros_thermod_delta_tl ,
State / unit .tl_set:N =
- \l_chemmacros_thermod_unit_tl ,
+ \l__chemmacros_thermod_unit_tl ,
setnewstate / subscript-left .tl_set:N =
- \l_chemmacros_thermod_subscript_left_default_tl ,
+ \l__chemmacros_thermod_subscript_left_default_tl ,
setnewstate / subscript .tl_set:N =
- \l_chemmacros_thermod_subscript_default_tl ,
+ \l__chemmacros_thermod_subscript_default_tl ,
setnewstate / exponent .tl_set:N =
- \l_chemmacros_thermod_exponent_default_tl ,
+ \l__chemmacros_thermod_exponent_default_tl ,
setnewstate / delta .tl_set:N =
- \l_chemmacros_thermod_delta_default_tl
+ \l__chemmacros_thermod_delta_default_tl
}
% \DeclareChemState[<keyval>]{<name>}{<symbol>}{<unit>}
-\bool_if:NF \l_chemmacros_version_one_bool
+\bool_if:NF \l__chemmacros_version_one_bool
{
\cs_new:Npn \DeclareChemState
{
- \bool_set_false:N \l_chemmacros_renewstate_bool
+ \bool_set_false:N \l__chemmacros_renewstate_bool
\chemmacros_setnewstate_reset:
\peek_meaning:NTF [
{ \setnewstate_aux_i:n }
@@ -2738,7 +2738,7 @@
% \RenewChemState[<keyval>]{<name>}{<symbol>}{<unit>}
\cs_new:Npn \RenewChemState
{
- \bool_set_true:N \l_chemmacros_renewstate_bool
+ \bool_set_true:N \l__chemmacros_renewstate_bool
\chemmacros_setnewstate_reset:
\peek_meaning:NTF [
{ \setnewstate_aux_i:n }
@@ -2760,10 +2760,10 @@
\cs_new_nopar:Npn \chemmacros_setnewstate_reset:
{
- \tl_set:Nn \l_chemmacros_thermod_subscript_left_default_tl { true }
- \tl_clear:N \l_chemmacros_thermod_subscript_default_tl
- \tl_set:Nn \l_chemmacros_thermod_exponent_default_tl { \standardstate }
- \tl_set:Nn \l_chemmacros_thermod_delta_default_tl { \Delta }
+ \tl_set:Nn \l__chemmacros_thermod_subscript_left_default_tl { true }
+ \tl_clear:N \l__chemmacros_thermod_subscript_default_tl
+ \tl_set:Nn \l__chemmacros_thermod_exponent_default_tl { \standardstate }
+ \tl_set:Nn \l__chemmacros_thermod_delta_default_tl { \Delta }
}
\cs_new:Npn \setnewstate_aux_i:n [#1]
@@ -2774,16 +2774,16 @@
\cs_new:Npn \setnewstate_aux_ii:nnn #1#2#3
{
- \bool_if:NTF \l_chemmacros_renewstate_bool
+ \bool_if:NTF \l__chemmacros_renewstate_bool
{
\cs_if_exist:cF { #1 }
{ \msg_error:nnx { chemmacros } { renewstate } { #1 } }
\cs_undefine:c {chemmacros_ #1 _reset: }
- \cs_undefine:c { l_chemmacros_ #1 _subscript_tl }
- \cs_undefine:c { l_chemmacros_ #1 _exponent_tl }
- \cs_undefine:c { l_chemmacros_ #1 _delta_tl }
- \cs_undefine:c { l_chemmacros_ #1 _left_tl }
- \cs_undefine:c { l_chemmacros_ #1 _unit_tl }
+ \cs_undefine:c { l__chemmacros_ #1 _subscript_tl }
+ \cs_undefine:c { l__chemmacros_ #1 _exponent_tl }
+ \cs_undefine:c { l__chemmacros_ #1 _delta_tl }
+ \cs_undefine:c { l__chemmacros_ #1 _left_tl }
+ \cs_undefine:c { l__chemmacros_ #1 _unit_tl }
\cs_undefine:c { #1 }
\cs_undefine:c { #1 _aux_i:n }
\cs_undefine:c { #1 _aux_ii:n }
@@ -2795,37 +2795,37 @@
}
\group_begin:
\exp_args:Nnf \tl_const:cn
- { l_chemmacros_ #1 _subscript_tl }
- { \tl_use:N \l_chemmacros_thermod_subscript_default_tl }
+ { l__chemmacros_ #1 _subscript_tl }
+ { \tl_use:N \l__chemmacros_thermod_subscript_default_tl }
\exp_args:Nnf \tl_const:cn
- { l_chemmacros_ #1 _exponent_tl }
- { \tl_use:N \l_chemmacros_thermod_exponent_default_tl }
+ { l__chemmacros_ #1 _exponent_tl }
+ { \tl_use:N \l__chemmacros_thermod_exponent_default_tl }
\exp_args:Nnf \tl_const:cn
- { l_chemmacros_ #1 _delta_tl }
- { \tl_use:N \l_chemmacros_thermod_delta_default_tl }
+ { l__chemmacros_ #1 _delta_tl }
+ { \tl_use:N \l__chemmacros_thermod_delta_default_tl }
\exp_args:Nnf \tl_const:cn
- { l_chemmacros_ #1 _left_tl }
- { \tl_use:N \l_chemmacros_thermod_subscript_left_default_tl }
+ { l__chemmacros_ #1 _left_tl }
+ { \tl_use:N \l__chemmacros_thermod_subscript_left_default_tl }
\tl_const:cn
- { l_chemmacros_ #1 _unit_tl }
+ { l__chemmacros_ #1 _unit_tl }
{ #3 }
\cs_new_nopar:cpn {chemmacros_ #1 _reset: }
{
\tl_set_eq:Nc
- \l_chemmacros_thermod_subscript_tl
- { l_chemmacros_ #1 _subscript_tl }
+ \l__chemmacros_thermod_subscript_tl
+ { l__chemmacros_ #1 _subscript_tl }
\tl_set_eq:Nc
- \l_chemmacros_thermod_exponent_tl
- { l_chemmacros_ #1 _exponent_tl }
+ \l__chemmacros_thermod_exponent_tl
+ { l__chemmacros_ #1 _exponent_tl }
\tl_set_eq:Nc
- \l_chemmacros_thermod_delta_tl
- { l_chemmacros_ #1 _delta_tl }
+ \l__chemmacros_thermod_delta_tl
+ { l__chemmacros_ #1 _delta_tl }
\tl_set_eq:Nc
- \l_chemmacros_thermod_subscript_left_tl
- { l_chemmacros_ #1 _left_tl }
+ \l__chemmacros_thermod_subscript_left_tl
+ { l__chemmacros_ #1 _left_tl }
\tl_set_eq:Nc
- \l_chemmacros_thermod_unit_tl
- { l_chemmacros_ #1 _unit_tl }
+ \l__chemmacros_thermod_unit_tl
+ { l__chemmacros_ #1 _unit_tl }
}
\cs_new_nopar:cpn { #1 }
{
@@ -2847,7 +2847,7 @@
}
\cs_new_nopar:cpn { #1 _aux_ii:n } (##1)
{
- \tl_set:Nn \l_chemmacros_thermod_subscript_tl { ##1 }
+ \tl_set:Nn \l__chemmacros_thermod_subscript_tl { ##1 }
\tl_use:c { #1 _aux_iii:n }
}
\cs_new_nopar:cpn { #1 _aux_iii:n } ##1
@@ -2855,15 +2855,15 @@
\ensuremath
{
\exp_args:Nf \tl_if_eq:nnTF
- { \tl_use:N \l_chemmacros_thermod_subscript_left_tl } { true }
+ { \tl_use:N \l__chemmacros_thermod_subscript_left_tl } { true }
{
\chemmacros_state:fnn
{
subscript-left = true ,
exponent =
- { \tl_use:N \l_chemmacros_thermod_exponent_tl } ,
+ { \tl_use:N \l__chemmacros_thermod_exponent_tl } ,
delta =
- { \tl_use:N \l_chemmacros_thermod_delta_tl }
+ { \tl_use:N \l__chemmacros_thermod_delta_tl }
}
{ #2 }
}
@@ -2872,15 +2872,15 @@
{
subscript-left = false ,
exponent =
- { \tl_use:N \l_chemmacros_thermod_exponent_tl } ,
+ { \tl_use:N \l__chemmacros_thermod_exponent_tl } ,
delta =
- { \tl_use:N \l_chemmacros_thermod_delta_tl }
+ { \tl_use:N \l__chemmacros_thermod_delta_tl }
}
{ #2 }
}
- { \tl_use:N \l_chemmacros_thermod_subscript_tl }
+ { \tl_use:N \l__chemmacros_thermod_subscript_tl }
=
- \exp_args:Nno \SI { ##1 } { \l_chemmacros_thermod_unit_tl }
+ \exp_args:Nno \SI { ##1 } { \l__chemmacros_thermod_unit_tl }
}
}
\group_end:
@@ -2888,7 +2888,7 @@
}
% predefined:
-\bool_if:NF \l_chemmacros_version_one_bool
+\bool_if:NF \l__chemmacros_version_one_bool
{
\DeclareChemState {Enthalpy} {H} {\kilo\joule\per\mole}
\DeclareChemState [ delta=false, subscript-left=false ] {Entropy}
@@ -2898,46 +2898,46 @@
% --------------------------------------------------------------------------- %
% Newman projections
-\fp_new:N \l_chemmacros_newman_rel_angle_fp
-\fp_zero:N \l_chemmacros_newman_rel_angle_fp
-\fp_new:N \l_chemmacros_newman_tmp_angle_fp
-\fp_new:N \l_chemmacros_newman_abs_angle_fp
-\fp_zero:N \l_chemmacros_newman_abs_angle_fp
+\fp_new:N \l__chemmacros_newman_rel_angle_fp
+\fp_zero:N \l__chemmacros_newman_rel_angle_fp
+\fp_new:N \l__chemmacros_newman_tmp_angle_fp
+\fp_new:N \l__chemmacros_newman_abs_angle_fp
+\fp_zero:N \l__chemmacros_newman_abs_angle_fp
-\fp_new:N \l_chemmacros_newman_scale_fp
-\fp_set:Nn \l_chemmacros_newman_scale_fp { 1 }
+\fp_new:N \l__chemmacros_newman_scale_fp
+\fp_set:Nn \l__chemmacros_newman_scale_fp { 1 }
-\tl_new:N \l_chemmacros_newman_tikz_ring_tl
-\tl_clear:N \l_chemmacros_newman_tikz_ring_tl
+\tl_new:N \l__chemmacros_newman_tikz_ring_tl
+\tl_clear:N \l__chemmacros_newman_tikz_ring_tl
-\tl_new:N \l_chemmacros_newman_tikz_front_tl
-\tl_clear:N \l_chemmacros_newman_tikz_front_tl
+\tl_new:N \l__chemmacros_newman_tikz_front_tl
+\tl_clear:N \l__chemmacros_newman_tikz_front_tl
-\tl_new:N \l_chemmacros_newman_tikz_back_tl
-\tl_clear:N \l_chemmacros_newman_tikz_back_tl
+\tl_new:N \l__chemmacros_newman_tikz_back_tl
+\tl_clear:N \l__chemmacros_newman_tikz_back_tl
-\bool_new:N \l_chemmacros_newman_tikz_back_bool
+\bool_new:N \l__chemmacros_newman_tikz_back_bool
-\fp_new:N \l_chemmacros_newman_x_fp
-\fp_new:N \l_chemmacros_newman_y_fp
+\fp_new:N \l__chemmacros_newman_x_fp
+\fp_new:N \l__chemmacros_newman_y_fp
\keys_define:nn { chemmacros / newman }
{
- ring .tl_set:N = \l_chemmacros_newman_tikz_ring_tl ,
- atoms .tl_set:N = \l_chemmacros_newman_tikz_front_tl ,
+ ring .tl_set:N = \l__chemmacros_newman_tikz_ring_tl ,
+ atoms .tl_set:N = \l__chemmacros_newman_tikz_front_tl ,
back-atoms .code:n =
{
- \bool_set_true:N \l_chemmacros_newman_tikz_back_bool
- \tl_set:Nn \l_chemmacros_newman_tikz_back_tl { #1 }
+ \bool_set_true:N \l__chemmacros_newman_tikz_back_bool
+ \tl_set:Nn \l__chemmacros_newman_tikz_back_tl { #1 }
} ,
- scale .fp_set:N = \l_chemmacros_newman_scale_fp ,
+ scale .fp_set:N = \l__chemmacros_newman_scale_fp ,
scale .default:n = 1 ,
- angle .fp_set:N = \l_chemmacros_newman_abs_angle_fp ,
+ angle .fp_set:N = \l__chemmacros_newman_abs_angle_fp ,
angle .default:n = 0
}
% \newman[<keyval>](<angle>){<1>,<2>,<3>,<4>,<5>,<6>}
-\bool_if:NF \l_chemmacros_version_one_bool
+\bool_if:NF \l__chemmacros_version_one_bool
{
\NewDocumentCommand \newman { o d() > { \SplitArgument { 5 } { , } } m }
{
@@ -2946,10 +2946,10 @@
\IfNoValueTF { #2 }
{
\fp_set_eq:NN
- \l_chemmacros_newman_rel_angle_fp
- \l_chemmacros_newman_abs_angle_fp
+ \l__chemmacros_newman_rel_angle_fp
+ \l__chemmacros_newman_abs_angle_fp
}
- { \fp_set:Nn \l_chemmacros_newman_rel_angle_fp { #2 } }
+ { \fp_set:Nn \l__chemmacros_newman_rel_angle_fp { #2 } }
\chemmacros_newman_atoms:nnnnnn #3
\group_end:
}
@@ -2960,26 +2960,26 @@
{
\chemmacros_tikz_picture:xn
{
- scale = \fp_to_tl:N \l_chemmacros_newman_scale_fp ,
+ scale = \fp_to_tl:N \l__chemmacros_newman_scale_fp ,
chemmacros_newman_atom_front / .style =
{
inner~sep=0,
outer~sep=0,
- \tl_use:N \l_chemmacros_newman_tikz_front_tl
+ \tl_use:N \l__chemmacros_newman_tikz_front_tl
},
chemmacros_newman_atom_back / .style =
{
inner~sep=0,
outer~sep=0,
- \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 }
+ \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 }
}
}
{
\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) ;
+ { \tl_use:N \l__chemmacros_newman_tikz_ring_tl }
+ (0,0) circle (\fp_to_dim:N \l__chemmacros_newman_scale_fp * 15) ;
\chemmacros_newman_back_node:nf
{ 30 }
{ \IfNoValueF { #5 } { #5 } }
@@ -3005,17 +3005,17 @@
% #1: angle pi #2: radius
\cs_new_nopar:Npn \chemmacros_newman_coordinates:nn #1#2
{
- \fp_set:Nn \l_chemmacros_newman_tmp_angle_fp { #1 }
- \fp_div:Nn \l_chemmacros_newman_tmp_angle_fp { 180 }
- \fp_mul:Nn \l_chemmacros_newman_tmp_angle_fp { \fp_use:N \c_pi_fp }
- \fp_zero:N \l_chemmacros_newman_x_fp
- \fp_zero:N \l_chemmacros_newman_y_fp
- \fp_cos:Nn \l_chemmacros_newman_x_fp
- { \fp_use:N \l_chemmacros_newman_tmp_angle_fp }
- \fp_sin:Nn \l_chemmacros_newman_y_fp
- { \fp_use:N \l_chemmacros_newman_tmp_angle_fp }
- \fp_mul:Nn \l_chemmacros_newman_x_fp { \fp_use:N #2 }
- \fp_mul:Nn \l_chemmacros_newman_y_fp { \fp_use:N #2 }
+ \fp_set:Nn \l__chemmacros_newman_tmp_angle_fp { #1 }
+ \fp_div:Nn \l__chemmacros_newman_tmp_angle_fp { 180 }
+ \fp_mul:Nn \l__chemmacros_newman_tmp_angle_fp { \fp_use:N \c_pi_fp }
+ \fp_zero:N \l__chemmacros_newman_x_fp
+ \fp_zero:N \l__chemmacros_newman_y_fp
+ \fp_cos:Nn \l__chemmacros_newman_x_fp
+ { \fp_use:N \l__chemmacros_newman_tmp_angle_fp }
+ \fp_sin:Nn \l__chemmacros_newman_y_fp
+ { \fp_use:N \l__chemmacros_newman_tmp_angle_fp }
+ \fp_mul:Nn \l__chemmacros_newman_x_fp { \fp_use:N #2 }
+ \fp_mul:Nn \l__chemmacros_newman_y_fp { \fp_use:N #2 }
}
\cs_generate_variant:Nn \chemmacros_newman_coordinates:nn { on }
@@ -3023,33 +3023,33 @@
\cs_new:Npn \chemmacros_newman_back_node:nn #1#2
{
\group_begin:
- \fp_add:Nn \l_chemmacros_newman_rel_angle_fp { #1 }
+ \fp_add:Nn \l__chemmacros_newman_rel_angle_fp { #1 }
\chemmacros_newman_coordinates:on
- { \fp_to_int:N \l_chemmacros_newman_rel_angle_fp }
- { \l_chemmacros_newman_scale_fp }
+ { \fp_to_int:N \l__chemmacros_newman_rel_angle_fp }
+ { \l__chemmacros_newman_scale_fp }
\chemmacros_tikz_draw:f
- { \tl_use:N \l_chemmacros_newman_tikz_ring_tl }
+ { \tl_use:N \l__chemmacros_newman_tikz_ring_tl }
(
- 15 * \fp_to_dim:N \l_chemmacros_newman_x_fp ,
- 15 * \fp_to_dim:N \l_chemmacros_newman_y_fp
+ 15 * \fp_to_dim:N \l__chemmacros_newman_x_fp ,
+ 15 * \fp_to_dim:N \l__chemmacros_newman_y_fp
)
--
(
- 30 * \fp_to_dim:N \l_chemmacros_newman_x_fp ,
- 30 * \fp_to_dim:N \l_chemmacros_newman_y_fp
+ 30 * \fp_to_dim:N \l__chemmacros_newman_x_fp ,
+ 30 * \fp_to_dim:N \l__chemmacros_newman_y_fp
) ;
\chemmacros_newman_coordinates:on
- { \fp_to_int:N \l_chemmacros_newman_rel_angle_fp }
- { \l_chemmacros_newman_scale_fp }
+ { \fp_to_int:N \l__chemmacros_newman_rel_angle_fp }
+ { \l__chemmacros_newman_scale_fp }
\chemmacros_tikz_node:f
{
chemmacros_newman_atom_back,
- anchor = -180 + \fp_to_int:N \l_chemmacros_newman_rel_angle_fp
+ anchor = -180 + \fp_to_int:N \l__chemmacros_newman_rel_angle_fp
}
at
(
- 31 * \fp_to_dim:N \l_chemmacros_newman_x_fp ,
- 31 * \fp_to_dim:N \l_chemmacros_newman_y_fp
+ 31 * \fp_to_dim:N \l__chemmacros_newman_x_fp ,
+ 31 * \fp_to_dim:N \l__chemmacros_newman_y_fp
)
{ #2 } ;
\group_end:
@@ -3059,21 +3059,21 @@
% place front nodes:
\cs_new:Npn \chemmacros_newman_front_node:nn #1#2
{
- \chemmacros_newman_coordinates:nn { #1 } { \l_chemmacros_newman_scale_fp }
+ \chemmacros_newman_coordinates:nn { #1 } { \l__chemmacros_newman_scale_fp }
\chemmacros_tikz_draw:f
- { \tl_use:N \l_chemmacros_newman_tikz_ring_tl }
+ { \tl_use:N \l__chemmacros_newman_tikz_ring_tl }
(0,0) -- ++
(
- 30 * \fp_to_dim:N \l_chemmacros_newman_x_fp ,
- 30 * \fp_to_dim:N \l_chemmacros_newman_y_fp
+ 30 * \fp_to_dim:N \l__chemmacros_newman_x_fp ,
+ 30 * \fp_to_dim:N \l__chemmacros_newman_y_fp
) ;
- \chemmacros_newman_coordinates:nn { #1 } { \l_chemmacros_newman_scale_fp }
+ \chemmacros_newman_coordinates:nn { #1 } { \l__chemmacros_newman_scale_fp }
\chemmacros_tikz_node:f
{ chemmacros_newman_atom_front, anchor = -180 + #1 }
at
(
- 31 * \fp_to_dim:N \l_chemmacros_newman_x_fp ,
- 31 * \fp_to_dim:N \l_chemmacros_newman_y_fp
+ 31 * \fp_to_dim:N \l__chemmacros_newman_x_fp ,
+ 31 * \fp_to_dim:N \l__chemmacros_newman_y_fp
)
{ #2 } ;
}
@@ -3082,147 +3082,147 @@
% --------------------------------------------------------------------------- %
% \orbital[<keyval>]{<type>}
% variables:
-\bool_new:N \l_chemmacros_orbital_type_s_bool
-\bool_new:N \l_chemmacros_orbital_type_p_bool
-\bool_new:N \l_chemmacros_orbital_type_sp_bool
-\bool_new:N \l_chemmacros_orbital_type_sptwo_bool
-\bool_new:N \l_chemmacros_orbital_type_spthree_bool
+\bool_new:N \l__chemmacros_orbital_type_s_bool
+\bool_new:N \l__chemmacros_orbital_type_p_bool
+\bool_new:N \l__chemmacros_orbital_type_sp_bool
+\bool_new:N \l__chemmacros_orbital_type_sptwo_bool
+\bool_new:N \l__chemmacros_orbital_type_spthree_bool
-\tl_new:N \l_chemmacros_orbital_s_color_tl
-\tl_set:Nn \l_chemmacros_orbital_s_color_tl { black }
-\tl_new:N \l_chemmacros_orbital_s_phase_color_tl
+\tl_new:N \l__chemmacros_orbital_s_color_tl
+\tl_set:Nn \l__chemmacros_orbital_s_color_tl { black }
+\tl_new:N \l__chemmacros_orbital_s_phase_color_tl
-\tl_new:N \l_chemmacros_orbital_p_color_tl
-\tl_set:Nn \l_chemmacros_orbital_p_color_tl { black }
-\tl_new:N \l_chemmacros_orbital_p_pphase_color_tl
-\tl_new:N \l_chemmacros_orbital_p_mphase_color_tl
+\tl_new:N \l__chemmacros_orbital_p_color_tl
+\tl_set:Nn \l__chemmacros_orbital_p_color_tl { black }
+\tl_new:N \l__chemmacros_orbital_p_pphase_color_tl
+\tl_new:N \l__chemmacros_orbital_p_mphase_color_tl
-\tl_new:N \l_chemmacros_orbital_sp_color_tl
-\tl_set:Nn \l_chemmacros_orbital_sp_color_tl { black }
-\tl_new:N \l_chemmacros_orbital_sp_pphase_color_tl
-\tl_new:N \l_chemmacros_orbital_sp_mphase_color_tl
+\tl_new:N \l__chemmacros_orbital_sp_color_tl
+\tl_set:Nn \l__chemmacros_orbital_sp_color_tl { black }
+\tl_new:N \l__chemmacros_orbital_sp_pphase_color_tl
+\tl_new:N \l__chemmacros_orbital_sp_mphase_color_tl
-\tl_new:N \l_chemmacros_orbital_sptwo_color_tl
-\tl_set:Nn \l_chemmacros_orbital_sptwo_color_tl { black }
-\tl_new:N \l_chemmacros_orbital_sptwo_pphase_color_tl
-\tl_new:N \l_chemmacros_orbital_sptwo_mphase_color_tl
+\tl_new:N \l__chemmacros_orbital_sptwo_color_tl
+\tl_set:Nn \l__chemmacros_orbital_sptwo_color_tl { black }
+\tl_new:N \l__chemmacros_orbital_sptwo_pphase_color_tl
+\tl_new:N \l__chemmacros_orbital_sptwo_mphase_color_tl
-\tl_new:N \l_chemmacros_orbital_spthree_color_tl
-\tl_set:Nn \l_chemmacros_orbital_spthree_color_tl { black }
-\tl_new:N \l_chemmacros_orbital_spthree_pphase_color_tl
-\tl_new:N \l_chemmacros_orbital_spthree_mphase_color_tl
+\tl_new:N \l__chemmacros_orbital_spthree_color_tl
+\tl_set:Nn \l__chemmacros_orbital_spthree_color_tl { black }
+\tl_new:N \l__chemmacros_orbital_spthree_pphase_color_tl
+\tl_new:N \l__chemmacros_orbital_spthree_mphase_color_tl
-\bool_new:N \l_chemmacros_orbital_s_phase_bool
-\bool_set_true:N \l_chemmacros_orbital_s_phase_bool
+\bool_new:N \l__chemmacros_orbital_s_phase_bool
+\bool_set_true:N \l__chemmacros_orbital_s_phase_bool
-\bool_new:N \l_chemmacros_orbital_p_phase_bool
-\bool_set_true:N \l_chemmacros_orbital_p_phase_bool
+\bool_new:N \l__chemmacros_orbital_p_phase_bool
+\bool_set_true:N \l__chemmacros_orbital_p_phase_bool
-\bool_new:N \l_chemmacros_orbital_sp_phase_bool
-\bool_set_true:N \l_chemmacros_orbital_sp_phase_bool
+\bool_new:N \l__chemmacros_orbital_sp_phase_bool
+\bool_set_true:N \l__chemmacros_orbital_sp_phase_bool
-\bool_new:N \l_chemmacros_orbital_sptwo_phase_bool
-\bool_set_true:N \l_chemmacros_orbital_sptwo_phase_bool
+\bool_new:N \l__chemmacros_orbital_sptwo_phase_bool
+\bool_set_true:N \l__chemmacros_orbital_sptwo_phase_bool
-\bool_new:N \l_chemmacros_orbital_spthree_phase_bool
-\bool_set_true:N \l_chemmacros_orbital_spthree_phase_bool
+\bool_new:N \l__chemmacros_orbital_spthree_phase_bool
+\bool_set_true:N \l__chemmacros_orbital_spthree_phase_bool
-\tl_new:N \l_chemmacros_orbital_s_scale_tl
-\tl_set:Nn \l_chemmacros_orbital_s_scale_tl { 1 }
+\tl_new:N \l__chemmacros_orbital_s_scale_tl
+\tl_set:Nn \l__chemmacros_orbital_s_scale_tl { 1 }
-\tl_new:N \l_chemmacros_orbital_p_scale_tl
-\tl_set:Nn \l_chemmacros_orbital_p_scale_tl { 1 }
+\tl_new:N \l__chemmacros_orbital_p_scale_tl
+\tl_set:Nn \l__chemmacros_orbital_p_scale_tl { 1 }
-\tl_new:N \l_chemmacros_orbital_sp_scale_tl
-\tl_set:Nn \l_chemmacros_orbital_sp_scale_tl { 1 }
+\tl_new:N \l__chemmacros_orbital_sp_scale_tl
+\tl_set:Nn \l__chemmacros_orbital_sp_scale_tl { 1 }
-\tl_new:N \l_chemmacros_orbital_sptwo_scale_tl
-\tl_set:Nn \l_chemmacros_orbital_sptwo_scale_tl { 1 }
+\tl_new:N \l__chemmacros_orbital_sptwo_scale_tl
+\tl_set:Nn \l__chemmacros_orbital_sptwo_scale_tl { 1 }
-\tl_new:N \l_chemmacros_orbital_spthree_scale_tl
-\tl_set:Nn \l_chemmacros_orbital_spthree_scale_tl { 1 }
+\tl_new:N \l__chemmacros_orbital_spthree_scale_tl
+\tl_set:Nn \l__chemmacros_orbital_spthree_scale_tl { 1 }
-\fp_new:N \l_chemmacros_orbital_angle_fp
-\fp_set:Nn \l_chemmacros_orbital_angle_fp { 90 }
+\fp_new:N \l__chemmacros_orbital_angle_fp
+\fp_set:Nn \l__chemmacros_orbital_angle_fp { 90 }
-\bool_new:N \l_chemmacros_orbital_p_half_bool
-\bool_set_false:N \l_chemmacros_orbital_p_half_bool
+\bool_new:N \l__chemmacros_orbital_p_half_bool
+\bool_set_false:N \l__chemmacros_orbital_p_half_bool
-\bool_new:N \l_chemmacros_orbital_overlay_bool
-\bool_set_false:N \l_chemmacros_orbital_overlay_bool
+\bool_new:N \l__chemmacros_orbital_overlay_bool
+\bool_set_false:N \l__chemmacros_orbital_overlay_bool
-\bool_new:N \l_chemmacros_orbital_opacity_bool
-\bool_set_false:N \l_chemmacros_opacity_overlay_bool
+\bool_new:N \l__chemmacros_orbital_opacity_bool
+\bool_set_false:N \l__chemmacros_opacity_overlay_bool
-\fp_new:N \l_chemmacros_orbital_opacity_fp
-\fp_set:Nn \l_chemmacros_orbital_opacity_fp { 0.5 }
+\fp_new:N \l__chemmacros_orbital_opacity_fp
+\fp_set:Nn \l__chemmacros_orbital_opacity_fp { 0.5 }
\cs_new_nopar:Npn \chemmacros_orbital_options:
{
\chemmacros_orbital_overlay: , \chemmacros_orbital_opacity: ,
inner~sep=0 , outer~sep=0 , line~width=.2pt ,
- rotate = { \fp_use:N \l_chemmacros_orbital_angle_fp - 90 } ,
+ rotate = { \fp_use:N \l__chemmacros_orbital_angle_fp - 90 } ,
baseline ,
minimum~size = 0
}
\cs_new_nopar:Npn \chemmacros_orbital_overlay:
{
- \bool_if:NT \l_chemmacros_orbital_overlay_bool { overlay }
+ \bool_if:NT \l__chemmacros_orbital_overlay_bool { overlay }
}
\cs_new_nopar:Npn \chemmacros_orbital_opacity:
{
- \bool_if:NT \l_chemmacros_orbital_opacity_bool
- { opacity = { \fp_use:N \l_chemmacros_orbital_opacity_fp } }
+ \bool_if:NT \l__chemmacros_orbital_opacity_bool
+ { opacity = { \fp_use:N \l__chemmacros_orbital_opacity_fp } }
}
% --------------------------------------------------------------------------- %
% s-orbitals
\cs_new_nopar:Npn \chemmacros_orbital_type_s:
{
- \bool_set_true:N \l_chemmacros_orbital_type_s_bool
- \bool_set_false:N \l_chemmacros_orbital_type_p_bool
- \bool_set_false:N \l_chemmacros_orbital_type_sp_bool
- \bool_set_false:N \l_chemmacros_orbital_type_sptwo_bool
- \bool_set_false:N \l_chemmacros_orbital_type_spthree_bool
+ \bool_set_true:N \l__chemmacros_orbital_type_s_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_p_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_sp_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_sptwo_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_spthree_bool
}
\keys_define:nn { chemmacros / orbital / s }
{
phase .choice: ,
phase / + .code:n =
- { \bool_set_true:N \l_chemmacros_orbital_s_phase_bool } ,
+ { \bool_set_true:N \l__chemmacros_orbital_s_phase_bool } ,
phase / - .code:n =
- { \bool_set_false:N \l_chemmacros_orbital_s_phase_bool } ,
- scale .tl_set:N = \l_chemmacros_orbital_s_scale_tl ,
- color .tl_set:N = \l_chemmacros_orbital_s_color_tl
+ { \bool_set_false:N \l__chemmacros_orbital_s_phase_bool } ,
+ scale .tl_set:N = \l__chemmacros_orbital_s_scale_tl ,
+ color .tl_set:N = \l__chemmacros_orbital_s_color_tl
}
\cs_new_nopar:Npn \chemmacros_orbital_s_draw:n #1
{
\IfNoValueF { #1 } { \keys_set:nn { chemmacros / orbital / s } { #1 } }
- \bool_if:NTF \l_chemmacros_orbital_s_phase_bool
+ \bool_if:NTF \l__chemmacros_orbital_s_phase_bool
{
- \tl_if_in:NnTF \l_chemmacros_orbital_s_color_tl { ! }
+ \tl_if_in:NnTF \l__chemmacros_orbital_s_color_tl { ! }
{
- \tl_set:Nn \l_chemmacros_orbital_s_phase_color_tl
- { \tl_use:N \l_chemmacros_orbital_s_color_tl }
+ \tl_set:Nn \l__chemmacros_orbital_s_phase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_s_color_tl }
}
{
- \tl_set:Nn \l_chemmacros_orbital_s_phase_color_tl
- { \tl_use:N \l_chemmacros_orbital_s_color_tl ! 90 }
+ \tl_set:Nn \l__chemmacros_orbital_s_phase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_s_color_tl ! 90 }
}
}
{
- \tl_set:Nn \l_chemmacros_orbital_s_phase_color_tl
+ \tl_set:Nn \l__chemmacros_orbital_s_phase_color_tl
{ black ! 5 }
}
\chemmacros_tikz_picture:xn{ \chemmacros_orbital_options: }
{
\chemmacros_tikz_shade:f
- { ball~color = \l_chemmacros_orbital_s_phase_color_tl }
- (0,0) circle (\l_chemmacros_orbital_s_scale_tl * .6em) ;
+ { ball~color = \l__chemmacros_orbital_s_phase_color_tl }
+ (0,0) circle (\l__chemmacros_orbital_s_scale_tl * .6em) ;
}
}
@@ -3230,92 +3230,92 @@
% p-orbitals
\cs_new_nopar:Npn \chemmacros_orbital_type_p:
{
- \bool_set_false:N \l_chemmacros_orbital_type_s_bool
- \bool_set_true:N \l_chemmacros_orbital_type_p_bool
- \bool_set_false:N \l_chemmacros_orbital_type_sp_bool
- \bool_set_false:N \l_chemmacros_orbital_type_sptwo_bool
- \bool_set_false:N \l_chemmacros_orbital_type_spthree_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_s_bool
+ \bool_set_true:N \l__chemmacros_orbital_type_p_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_sp_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_sptwo_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_spthree_bool
}
\keys_define:nn { chemmacros / orbital / p }
{
phase .choice: ,
phase / + .code:n =
- { \bool_set_true:N \l_chemmacros_orbital_p_phase_bool } ,
+ { \bool_set_true:N \l__chemmacros_orbital_p_phase_bool } ,
phase / - .code:n =
- { \bool_set_false:N \l_chemmacros_orbital_p_phase_bool } ,
- scale .tl_set:N = \l_chemmacros_orbital_p_scale_tl ,
- angle .fp_set:N = \l_chemmacros_orbital_angle_fp ,
- color .tl_set:N = \l_chemmacros_orbital_p_color_tl ,
- half .bool_set:N = \l_chemmacros_orbital_p_half_bool ,
+ { \bool_set_false:N \l__chemmacros_orbital_p_phase_bool } ,
+ scale .tl_set:N = \l__chemmacros_orbital_p_scale_tl ,
+ angle .fp_set:N = \l__chemmacros_orbital_angle_fp ,
+ color .tl_set:N = \l__chemmacros_orbital_p_color_tl ,
+ half .bool_set:N = \l__chemmacros_orbital_p_half_bool ,
half .default:n = true
}
\cs_new_nopar:Npn \chemmacros_orbital_p_draw:n #1
{
\IfNoValueF { #1 } { \keys_set:nn { chemmacros / orbital / p } { #1 } }
- \bool_if:NTF \l_chemmacros_orbital_p_phase_bool
+ \bool_if:NTF \l__chemmacros_orbital_p_phase_bool
{
- \tl_if_in:NnTF \l_chemmacros_orbital_p_color_tl { ! }
+ \tl_if_in:NnTF \l__chemmacros_orbital_p_color_tl { ! }
{
- \tl_set:Nn \l_chemmacros_orbital_p_pphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_p_color_tl }
+ \tl_set:Nn \l__chemmacros_orbital_p_pphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_p_color_tl }
}
{
- \tl_set:Nn \l_chemmacros_orbital_p_pphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_p_color_tl ! 90 }
+ \tl_set:Nn \l__chemmacros_orbital_p_pphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_p_color_tl ! 90 }
}
- \tl_set:Nn \l_chemmacros_orbital_p_mphase_color_tl
+ \tl_set:Nn \l__chemmacros_orbital_p_mphase_color_tl
{ black ! 5 }
}
{
- \tl_if_in:NnTF \l_chemmacros_orbital_p_color_tl { ! }
+ \tl_if_in:NnTF \l__chemmacros_orbital_p_color_tl { ! }
{
- \tl_set:Nn \l_chemmacros_orbital_p_mphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_p_color_tl }
+ \tl_set:Nn \l__chemmacros_orbital_p_mphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_p_color_tl }
}
{
- \tl_set:Nn \l_chemmacros_orbital_p_mphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_p_color_tl ! 90 }
+ \tl_set:Nn \l__chemmacros_orbital_p_mphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_p_color_tl ! 90 }
}
- \tl_set:Nn \l_chemmacros_orbital_p_pphase_color_tl
+ \tl_set:Nn \l__chemmacros_orbital_p_pphase_color_tl
{ black ! 5 }
}
\chemmacros_tikz_picture:xn { \chemmacros_orbital_options: }
{
\chemmacros_tikz_shadedraw:f
{
- draw = \l_chemmacros_orbital_p_pphase_color_tl ,
- ball~color = \l_chemmacros_orbital_p_pphase_color_tl
+ draw = \l__chemmacros_orbital_p_pphase_color_tl ,
+ ball~color = \l__chemmacros_orbital_p_pphase_color_tl
}
(0,0) .. controls ++
(
- - \l_chemmacros_orbital_p_scale_tl * 2em ,
- \l_chemmacros_orbital_p_scale_tl * 2em
+ - \l__chemmacros_orbital_p_scale_tl * 2em ,
+ \l__chemmacros_orbital_p_scale_tl * 2em
)
and ++
(
- \l_chemmacros_orbital_p_scale_tl * 2em ,
- \l_chemmacros_orbital_p_scale_tl * 2em
+ \l__chemmacros_orbital_p_scale_tl * 2em ,
+ \l__chemmacros_orbital_p_scale_tl * 2em
)
.. (0,0);
- \bool_if:NF \l_chemmacros_orbital_p_half_bool
+ \bool_if:NF \l__chemmacros_orbital_p_half_bool
{
\chemmacros_tikz_shadedraw:f
{
- draw = \l_chemmacros_orbital_p_mphase_color_tl ,
- ball~color = \l_chemmacros_orbital_p_mphase_color_tl
+ draw = \l__chemmacros_orbital_p_mphase_color_tl ,
+ ball~color = \l__chemmacros_orbital_p_mphase_color_tl
}
(0,0) .. controls ++
(
- - \l_chemmacros_orbital_p_scale_tl * 2em ,
- - \l_chemmacros_orbital_p_scale_tl * 2em
+ - \l__chemmacros_orbital_p_scale_tl * 2em ,
+ - \l__chemmacros_orbital_p_scale_tl * 2em
)
and ++
(
- \l_chemmacros_orbital_p_scale_tl * 2em ,
- - \l_chemmacros_orbital_p_scale_tl * 2em
+ \l__chemmacros_orbital_p_scale_tl * 2em ,
+ - \l__chemmacros_orbital_p_scale_tl * 2em
)
.. (0,0);
}
@@ -3326,88 +3326,88 @@
% sp-orbitals
\cs_new_nopar:Npn \chemmacros_orbital_type_sp:
{
- \bool_set_false:N \l_chemmacros_orbital_type_s_bool
- \bool_set_false:N \l_chemmacros_orbital_type_p_bool
- \bool_set_true:N \l_chemmacros_orbital_type_sp_bool
- \bool_set_false:N \l_chemmacros_orbital_type_sptwo_bool
- \bool_set_false:N \l_chemmacros_orbital_type_spthree_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_s_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_p_bool
+ \bool_set_true:N \l__chemmacros_orbital_type_sp_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_sptwo_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_spthree_bool
}
\keys_define:nn { chemmacros / orbital / sp }
{
phase .choice: ,
phase / + .code:n =
- { \bool_set_true:N \l_chemmacros_orbital_sp_phase_bool } ,
+ { \bool_set_true:N \l__chemmacros_orbital_sp_phase_bool } ,
phase / - .code:n =
- { \bool_set_false:N \l_chemmacros_orbital_sp_phase_bool } ,
- scale .tl_set:N = \l_chemmacros_orbital_sp_scale_tl ,
- angle .fp_set:N = \l_chemmacros_orbital_angle_fp ,
- color .tl_set:N = \l_chemmacros_orbital_sp_color_tl
+ { \bool_set_false:N \l__chemmacros_orbital_sp_phase_bool } ,
+ scale .tl_set:N = \l__chemmacros_orbital_sp_scale_tl ,
+ angle .fp_set:N = \l__chemmacros_orbital_angle_fp ,
+ color .tl_set:N = \l__chemmacros_orbital_sp_color_tl
}
\cs_new_nopar:Npn \chemmacros_orbital_sp_draw:n #1
{
\IfNoValueF { #1 } { \keys_set:nn { chemmacros / orbital / sp } { #1 } }
- \bool_if:NTF \l_chemmacros_orbital_sp_phase_bool
+ \bool_if:NTF \l__chemmacros_orbital_sp_phase_bool
{
- \tl_if_in:NnTF \l_chemmacros_orbital_sp_color_tl { ! }
+ \tl_if_in:NnTF \l__chemmacros_orbital_sp_color_tl { ! }
{
- \tl_set:Nn \l_chemmacros_orbital_sp_pphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_sp_color_tl }
+ \tl_set:Nn \l__chemmacros_orbital_sp_pphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_sp_color_tl }
}
{
- \tl_set:Nn \l_chemmacros_orbital_sp_pphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_sp_color_tl ! 90 }
+ \tl_set:Nn \l__chemmacros_orbital_sp_pphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_sp_color_tl ! 90 }
}
- \tl_set:Nn \l_chemmacros_orbital_sp_mphase_color_tl
+ \tl_set:Nn \l__chemmacros_orbital_sp_mphase_color_tl
{ black ! 5 }
}
{
- \tl_if_in:NnTF \l_chemmacros_orbital_sp_color_tl { ! }
+ \tl_if_in:NnTF \l__chemmacros_orbital_sp_color_tl { ! }
{
- \tl_set:Nn \l_chemmacros_orbital_sp_mphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_sp_color_tl }
+ \tl_set:Nn \l__chemmacros_orbital_sp_mphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_sp_color_tl }
}
{
- \tl_set:Nn \l_chemmacros_orbital_sp_mphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_sp_color_tl ! 90 }
+ \tl_set:Nn \l__chemmacros_orbital_sp_mphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_sp_color_tl ! 90 }
}
- \tl_set:Nn \l_chemmacros_orbital_sp_pphase_color_tl
+ \tl_set:Nn \l__chemmacros_orbital_sp_pphase_color_tl
{ black ! 5 }
}
\chemmacros_tikz_picture:xn { \chemmacros_orbital_options: }
{
\chemmacros_tikz_shadedraw:f
{
- draw = \l_chemmacros_orbital_sp_pphase_color_tl ,
- ball~color = \l_chemmacros_orbital_sp_pphase_color_tl
+ draw = \l__chemmacros_orbital_sp_pphase_color_tl ,
+ ball~color = \l__chemmacros_orbital_sp_pphase_color_tl
}
(0,0) .. controls ++
(
- - \l_chemmacros_orbital_sp_scale_tl * 2em ,
- \l_chemmacros_orbital_sp_scale_tl * 2em
+ - \l__chemmacros_orbital_sp_scale_tl * 2em ,
+ \l__chemmacros_orbital_sp_scale_tl * 2em
)
and ++
(
- \l_chemmacros_orbital_sp_scale_tl * 2em ,
- \l_chemmacros_orbital_sp_scale_tl * 2em
+ \l__chemmacros_orbital_sp_scale_tl * 2em ,
+ \l__chemmacros_orbital_sp_scale_tl * 2em
)
.. (0,0);
\chemmacros_tikz_shadedraw:f
{
- draw = \l_chemmacros_orbital_sp_mphase_color_tl ,
- ball~color = \l_chemmacros_orbital_sp_mphase_color_tl
+ draw = \l__chemmacros_orbital_sp_mphase_color_tl ,
+ ball~color = \l__chemmacros_orbital_sp_mphase_color_tl
}
(0,0) .. controls ++
(
- - \l_chemmacros_orbital_sp_scale_tl * .6em ,
- - \l_chemmacros_orbital_sp_scale_tl * .6em
+ - \l__chemmacros_orbital_sp_scale_tl * .6em ,
+ - \l__chemmacros_orbital_sp_scale_tl * .6em
)
and ++
(
- \l_chemmacros_orbital_sp_scale_tl * .6em ,
- - \l_chemmacros_orbital_sp_scale_tl * .6em
+ \l__chemmacros_orbital_sp_scale_tl * .6em ,
+ - \l__chemmacros_orbital_sp_scale_tl * .6em
)
.. (0,0);
}
@@ -3417,88 +3417,88 @@
% sp2-orbitals
\cs_new_nopar:Npn \chemmacros_orbital_type_sptwo:
{
- \bool_set_false:N \l_chemmacros_orbital_type_s_bool
- \bool_set_false:N \l_chemmacros_orbital_type_p_bool
- \bool_set_false:N \l_chemmacros_orbital_type_sp_bool
- \bool_set_true:N \l_chemmacros_orbital_type_sptwo_bool
- \bool_set_false:N \l_chemmacros_orbital_type_spthree_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_s_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_p_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_sp_bool
+ \bool_set_true:N \l__chemmacros_orbital_type_sptwo_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_spthree_bool
}
\keys_define:nn { chemmacros / orbital / sp2 }
{
phase .choice: ,
phase / + .code:n =
- { \bool_set_true:N \l_chemmacros_orbital_sptwo_phase_bool } ,
+ { \bool_set_true:N \l__chemmacros_orbital_sptwo_phase_bool } ,
phase / - .code:n =
- { \bool_set_false:N \l_chemmacros_orbital_sptwo_phase_bool } ,
- scale .tl_set:N = \l_chemmacros_orbital_sptwo_scale_tl ,
- angle .fp_set:N = \l_chemmacros_orbital_angle_fp ,
- color .tl_set:N = \l_chemmacros_orbital_sptwo_color_tl
+ { \bool_set_false:N \l__chemmacros_orbital_sptwo_phase_bool } ,
+ scale .tl_set:N = \l__chemmacros_orbital_sptwo_scale_tl ,
+ angle .fp_set:N = \l__chemmacros_orbital_angle_fp ,
+ color .tl_set:N = \l__chemmacros_orbital_sptwo_color_tl
}
\cs_new_nopar:Npn \chemmacros_orbital_sptwo_draw:n #1
{
\IfNoValueF { #1 } { \keys_set:nn { chemmacros / orbital / sp2 } { #1 } }
- \bool_if:NTF \l_chemmacros_orbital_sptwo_phase_bool
+ \bool_if:NTF \l__chemmacros_orbital_sptwo_phase_bool
{
- \tl_if_in:NnTF \l_chemmacros_orbital_sptwo_color_tl { ! }
+ \tl_if_in:NnTF \l__chemmacros_orbital_sptwo_color_tl { ! }
{
- \tl_set:Nn \l_chemmacros_orbital_sptwo_pphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_sptwo_color_tl }
+ \tl_set:Nn \l__chemmacros_orbital_sptwo_pphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_sptwo_color_tl }
}
{
- \tl_set:Nn \l_chemmacros_orbital_sptwo_pphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_sptwo_color_tl ! 90 }
+ \tl_set:Nn \l__chemmacros_orbital_sptwo_pphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_sptwo_color_tl ! 90 }
}
- \tl_set:Nn \l_chemmacros_orbital_sptwo_mphase_color_tl
+ \tl_set:Nn \l__chemmacros_orbital_sptwo_mphase_color_tl
{ black ! 5 }
}
{
- \tl_if_in:NnTF \l_chemmacros_orbital_sptwo_color_tl { ! }
+ \tl_if_in:NnTF \l__chemmacros_orbital_sptwo_color_tl { ! }
{
- \tl_set:Nn \l_chemmacros_orbital_sptwo_mphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_sptwo_color_tl }
+ \tl_set:Nn \l__chemmacros_orbital_sptwo_mphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_sptwo_color_tl }
}
{
- \tl_set:Nn \l_chemmacros_orbital_sptwo_mphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_sptwo_color_tl ! 90 }
+ \tl_set:Nn \l__chemmacros_orbital_sptwo_mphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_sptwo_color_tl ! 90 }
}
- \tl_set:Nn \l_chemmacros_orbital_sptwo_pphase_color_tl
+ \tl_set:Nn \l__chemmacros_orbital_sptwo_pphase_color_tl
{ black ! 5 }
}
\chemmacros_tikz_picture:xn { \chemmacros_orbital_options: }
{
\chemmacros_tikz_shadedraw:f
{
- draw = \l_chemmacros_orbital_sptwo_pphase_color_tl ,
- ball~color = \l_chemmacros_orbital_sptwo_pphase_color_tl
+ draw = \l__chemmacros_orbital_sptwo_pphase_color_tl ,
+ ball~color = \l__chemmacros_orbital_sptwo_pphase_color_tl
}
(0,0) .. controls ++
(
- - \l_chemmacros_orbital_sptwo_scale_tl * 2em ,
- \l_chemmacros_orbital_sptwo_scale_tl * 2em
+ - \l__chemmacros_orbital_sptwo_scale_tl * 2em ,
+ \l__chemmacros_orbital_sptwo_scale_tl * 2em
)
and ++
(
- \l_chemmacros_orbital_sptwo_scale_tl * 2em ,
- \l_chemmacros_orbital_sptwo_scale_tl * 2em
+ \l__chemmacros_orbital_sptwo_scale_tl * 2em ,
+ \l__chemmacros_orbital_sptwo_scale_tl * 2em
)
.. (0,0);
\chemmacros_tikz_shadedraw:f
{
- draw = \l_chemmacros_orbital_sptwo_mphase_color_tl ,
- ball~color = \l_chemmacros_orbital_sptwo_mphase_color_tl
+ draw = \l__chemmacros_orbital_sptwo_mphase_color_tl ,
+ ball~color = \l__chemmacros_orbital_sptwo_mphase_color_tl
}
(0,0) .. controls ++
(
- - \l_chemmacros_orbital_sptwo_scale_tl * .8em ,
- - \l_chemmacros_orbital_sptwo_scale_tl * .8em
+ - \l__chemmacros_orbital_sptwo_scale_tl * .8em ,
+ - \l__chemmacros_orbital_sptwo_scale_tl * .8em
)
and ++
(
- \l_chemmacros_orbital_sptwo_scale_tl * .8em ,
- - \l_chemmacros_orbital_sptwo_scale_tl * .8em
+ \l__chemmacros_orbital_sptwo_scale_tl * .8em ,
+ - \l__chemmacros_orbital_sptwo_scale_tl * .8em
)
.. (0,0);
}
@@ -3508,88 +3508,88 @@
% sp3-orbitals
\cs_new_nopar:Npn \chemmacros_orbital_type_spthree:
{
- \bool_set_false:N \l_chemmacros_orbital_type_s_bool
- \bool_set_false:N \l_chemmacros_orbital_type_p_bool
- \bool_set_false:N \l_chemmacros_orbital_type_sp_bool
- \bool_set_false:N \l_chemmacros_orbital_type_sptwo_bool
- \bool_set_true:N \l_chemmacros_orbital_type_spthree_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_s_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_p_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_sp_bool
+ \bool_set_false:N \l__chemmacros_orbital_type_sptwo_bool
+ \bool_set_true:N \l__chemmacros_orbital_type_spthree_bool
}
\keys_define:nn { chemmacros / orbital / sp3 }
{
phase .choice: ,
phase / + .code:n =
- { \bool_set_true:N \l_chemmacros_orbital_spthree_phase_bool } ,
+ { \bool_set_true:N \l__chemmacros_orbital_spthree_phase_bool } ,
phase / - .code:n =
- { \bool_set_false:N \l_chemmacros_orbital_spthree_phase_bool } ,
- scale .tl_set:N = \l_chemmacros_orbital_spthree_scale_tl ,
- angle .fp_set:N = \l_chemmacros_orbital_angle_fp ,
- color .tl_set:N = \l_chemmacros_orbital_spthree_color_tl
+ { \bool_set_false:N \l__chemmacros_orbital_spthree_phase_bool } ,
+ scale .tl_set:N = \l__chemmacros_orbital_spthree_scale_tl ,
+ angle .fp_set:N = \l__chemmacros_orbital_angle_fp ,
+ color .tl_set:N = \l__chemmacros_orbital_spthree_color_tl
}
\cs_new_nopar:Npn \chemmacros_orbital_spthree_draw:n #1
{
\IfNoValueF { #1 } { \keys_set:nn { chemmacros / orbital / sp3 } { #1 } }
- \bool_if:NTF \l_chemmacros_orbital_spthree_phase_bool
+ \bool_if:NTF \l__chemmacros_orbital_spthree_phase_bool
{
- \tl_if_in:NnTF \l_chemmacros_orbital_spthree_color_tl { ! }
+ \tl_if_in:NnTF \l__chemmacros_orbital_spthree_color_tl { ! }
{
- \tl_set:Nn \l_chemmacros_orbital_spthree_pphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_spthree_color_tl }
+ \tl_set:Nn \l__chemmacros_orbital_spthree_pphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_spthree_color_tl }
}
{
- \tl_set:Nn \l_chemmacros_orbital_spthree_pphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_spthree_color_tl ! 90 }
+ \tl_set:Nn \l__chemmacros_orbital_spthree_pphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_spthree_color_tl ! 90 }
}
- \tl_set:Nn \l_chemmacros_orbital_spthree_mphase_color_tl
+ \tl_set:Nn \l__chemmacros_orbital_spthree_mphase_color_tl
{ black ! 5 }
}
{
- \tl_if_in:NnTF \l_chemmacros_orbital_spthree_color_tl { ! }
+ \tl_if_in:NnTF \l__chemmacros_orbital_spthree_color_tl { ! }
{
- \tl_set:Nn \l_chemmacros_orbital_spthree_mphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_spthree_color_tl }
+ \tl_set:Nn \l__chemmacros_orbital_spthree_mphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_spthree_color_tl }
}
{
- \tl_set:Nn \l_chemmacros_orbital_spthree_mphase_color_tl
- { \tl_use:N \l_chemmacros_orbital_spthree_color_tl ! 90 }
+ \tl_set:Nn \l__chemmacros_orbital_spthree_mphase_color_tl
+ { \tl_use:N \l__chemmacros_orbital_spthree_color_tl ! 90 }
}
- \tl_set:Nn \l_chemmacros_orbital_spthree_pphase_color_tl
+ \tl_set:Nn \l__chemmacros_orbital_spthree_pphase_color_tl
{ black ! 5 }
}
\chemmacros_tikz_picture:xn { \chemmacros_orbital_options: }
{
\chemmacros_tikz_shadedraw:f
{
- draw = \l_chemmacros_orbital_spthree_pphase_color_tl ,
- ball~color = \l_chemmacros_orbital_spthree_pphase_color_tl
+ draw = \l__chemmacros_orbital_spthree_pphase_color_tl ,
+ ball~color = \l__chemmacros_orbital_spthree_pphase_color_tl
}
(0,0) .. controls ++
(
- - \l_chemmacros_orbital_spthree_scale_tl * 2em ,
- \l_chemmacros_orbital_spthree_scale_tl * 2em
+ - \l__chemmacros_orbital_spthree_scale_tl * 2em ,
+ \l__chemmacros_orbital_spthree_scale_tl * 2em
)
and ++
(
- \l_chemmacros_orbital_spthree_scale_tl * 2em ,
- \l_chemmacros_orbital_spthree_scale_tl * 2em
+ \l__chemmacros_orbital_spthree_scale_tl * 2em ,
+ \l__chemmacros_orbital_spthree_scale_tl * 2em
)
.. (0,0);
\chemmacros_tikz_shadedraw:f
{
- draw = \l_chemmacros_orbital_spthree_mphase_color_tl ,
- ball~color = \l_chemmacros_orbital_spthree_mphase_color_tl
+ draw = \l__chemmacros_orbital_spthree_mphase_color_tl ,
+ ball~color = \l__chemmacros_orbital_spthree_mphase_color_tl
}
(0,0) .. controls ++
(
- - \l_chemmacros_orbital_spthree_scale_tl * 1em ,
- - \l_chemmacros_orbital_spthree_scale_tl * 1em
+ - \l__chemmacros_orbital_spthree_scale_tl * 1em ,
+ - \l__chemmacros_orbital_spthree_scale_tl * 1em
)
and ++
(
- \l_chemmacros_orbital_spthree_scale_tl * 1em ,
- - \l_chemmacros_orbital_spthree_scale_tl * 1em
+ \l__chemmacros_orbital_spthree_scale_tl * 1em ,
+ - \l__chemmacros_orbital_spthree_scale_tl * 1em
)
.. (0,0);
}
@@ -3599,14 +3599,14 @@
% main command
\keys_define:nn { chemmacros / orbital }
{
- overlay .bool_set:N = \l_chemmacros_orbital_overlay_bool ,
+ overlay .bool_set:N = \l__chemmacros_orbital_overlay_bool ,
overlay .default:n = true ,
opacity .code:n =
{
\fp_compare:nTF { #1 = 1 }
- { \bool_set_false:N \l_chemmacros_orbital_opacity_bool }
- { \bool_set_true:N \l_chemmacros_orbital_opacity_bool }
- \fp_set:Nn \l_chemmacros_orbital_opacity_fp { #1 }
+ { \bool_set_false:N \l__chemmacros_orbital_opacity_bool }
+ { \bool_set_true:N \l__chemmacros_orbital_opacity_bool }
+ \fp_set:Nn \l__chemmacros_orbital_opacity_fp { #1 }
}
}
@@ -3623,33 +3623,33 @@
{
\group_begin:
\keys_set:nn { chemmacros / orbital / type } { #2 }
- \bool_if:NT \l_chemmacros_orbital_type_s_bool
+ \bool_if:NT \l__chemmacros_orbital_type_s_bool
{ \chemmacros_orbital_s_draw:n { #1 } }
- \bool_if:NT \l_chemmacros_orbital_type_p_bool
+ \bool_if:NT \l__chemmacros_orbital_type_p_bool
{ \chemmacros_orbital_p_draw:n { #1 } }
- \bool_if:NT \l_chemmacros_orbital_type_sp_bool
+ \bool_if:NT \l__chemmacros_orbital_type_sp_bool
{ \chemmacros_orbital_sp_draw:n { #1 } }
- \bool_if:NT \l_chemmacros_orbital_type_sptwo_bool
+ \bool_if:NT \l__chemmacros_orbital_type_sptwo_bool
{ \chemmacros_orbital_sptwo_draw:n { #1 } }
- \bool_if:NT \l_chemmacros_orbital_type_spthree_bool
+ \bool_if:NT \l__chemmacros_orbital_type_spthree_bool
{ \chemmacros_orbital_spthree_draw:n { #1 } }
\group_end:
}
% --------------------------------------------------------------------------- %
% arrow tips for electron movement
-\dim_new:N \l_chemmacros_el_length_dim
+\dim_new:N \l__chemmacros_el_length_dim
% full tip for pairs
\pgfarrowsdeclare { el } { el }
{
- \dim_set:Nn \l_chemmacros_el_length_dim
+ \dim_set:Nn \l__chemmacros_el_length_dim
{ 2.5pt + 2.5\pgflinewidth }
- \pgfarrowsleftextend { -\l_chemmacros_el_length_dim }
+ \pgfarrowsleftextend { -\l__chemmacros_el_length_dim }
\pgfarrowsrightextend { .5\pgflinewidth }
}
{
- \dim_set:Nn \l_chemmacros_el_length_dim
+ \dim_set:Nn \l__chemmacros_el_length_dim
{ 2.5pt + 2.5\pgflinewidth }
\pgfsetdash {} { 0pt }
\pgfsetroundjoin
@@ -3658,16 +3658,16 @@
\pgfpathlineto
{
\pgfpoint
- { -\l_chemmacros_el_length_dim }
- { .3\l_chemmacros_el_length_dim }
+ { -\l__chemmacros_el_length_dim }
+ { .3\l__chemmacros_el_length_dim }
}
\pgfpathlineto
- { \pgfpoint { -.5\l_chemmacros_el_length_dim } { 0pt } }
+ { \pgfpoint { -.5\l__chemmacros_el_length_dim } { 0pt } }
\pgfpathlineto
{
\pgfpoint
- { -\l_chemmacros_el_length_dim }
- { -.3\l_chemmacros_el_length_dim }
+ { -\l__chemmacros_el_length_dim }
+ { -.3\l__chemmacros_el_length_dim }
}
\pgfpathlineto { \pgfpoint { 0pt } { 0pt } }
\pgfusepathqfillstroke
@@ -3676,13 +3676,13 @@
% half tip on the left
\pgfarrowsdeclare { left~el } { left~el }
{
- \dim_set:Nn \l_chemmacros_el_length_dim
+ \dim_set:Nn \l__chemmacros_el_length_dim
{ 2.5pt + 2.5\pgflinewidth }
- \pgfarrowsleftextend { -\l_chemmacros_el_length_dim }
+ \pgfarrowsleftextend { -\l__chemmacros_el_length_dim }
\pgfarrowsrightextend { .5\pgflinewidth }
}
{
- \dim_set:Nn \l_chemmacros_el_length_dim
+ \dim_set:Nn \l__chemmacros_el_length_dim
{ 2.5pt + 2.5\pgflinewidth }
\pgfsetdash {} { 0pt }
\pgfsetroundjoin
@@ -3691,10 +3691,10 @@
\pgfpathlineto
{
\pgfpoint
- { -\l_chemmacros_el_length_dim }
- { .3\l_chemmacros_el_length_dim }
+ { -\l__chemmacros_el_length_dim }
+ { .3\l__chemmacros_el_length_dim }
}
- \pgfpathlineto { \pgfpoint { -.5\l_chemmacros_el_length_dim } { 0pt } }
+ \pgfpathlineto { \pgfpoint { -.5\l__chemmacros_el_length_dim } { 0pt } }
\pgfpathlineto { \pgfpoint { 0pt } { 0pt } }
\pgfusepathqfillstroke
}
@@ -3702,13 +3702,13 @@
% half tip in the right
\pgfarrowsdeclare { right~el } { right~el }
{
- \dim_set:Nn \l_chemmacros_el_length_dim
+ \dim_set:Nn \l__chemmacros_el_length_dim
{ 2.5pt + 2.5\pgflinewidth }
- \pgfarrowsleftextend { -\l_chemmacros_el_length_dim }
+ \pgfarrowsleftextend { -\l__chemmacros_el_length_dim }
\pgfarrowsrightextend { .5\pgflinewidth }
}
{
- \dim_set:Nn \l_chemmacros_el_length_dim
+ \dim_set:Nn \l__chemmacros_el_length_dim
{ 2.5pt + 2.5\pgflinewidth }
\pgfsetdash {} { 0pt }
\pgfsetroundjoin
@@ -3717,10 +3717,10 @@
\pgfpathlineto
{
\pgfpoint
- { -\l_chemmacros_el_length_dim }
- { -.3\l_chemmacros_el_length_dim }
+ { -\l__chemmacros_el_length_dim }
+ { -.3\l__chemmacros_el_length_dim }
}
- \pgfpathlineto { \pgfpoint { -.5\l_chemmacros_el_length_dim } { 0pt } }
+ \pgfpathlineto { \pgfpoint { -.5\l__chemmacros_el_length_dim } { 0pt } }
\pgfpathlineto { \pgfpoint { 0pt } { 0pt } }
\pgfusepathqfillstroke
}
@@ -3737,7 +3737,7 @@
% --------------------------------------------------------------------------- %
% load old definitions:
-\bool_if:NT \l_chemmacros_version_one_bool
+\bool_if:NT \l__chemmacros_version_one_bool
{
\input { chemmacros-version1 . cfg }
}
@@ -3886,9 +3886,12 @@ Version history
- radical point thicker, new options `radical-style'
and `radical-radius'
2012/10/03 - version 3.4a - bug fix in coupling constant \J
+2013/01/04 - version 3.4b - bug fix in the sub- and superscript handling
% --------------------------------------------------------------------------- %
% TODO:
- ox-option xfrac vs math?
- drop option `bpchem'
-- add d-orbitals \ No newline at end of file
+- add d-orbitals
+- add kpfonts to `greek' option so \Chemalpha and kin use \alphaup ... of kpfonts
+ package \ No newline at end of file