%% %% This is file `lwarp-chemmacros.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% lwarp.dtx (with options: `chemmacros') %% This is a generated file. %% Copyright 2016-2022 Brian Dunn %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 %% of this license or (at your option) any later version. %% The latest version of this license is in %% http://www.latex-project.org/lppl.txt %% and version 1.3 or later is part of all distributions of LaTeX %% version 2005/12/01 or later. \LWR@ProvidesPackagePass{chemmacros}[2022/02/13] \ExplSyntaxOn \prg_set_conditional:Npnn \chemmacros_if_package_loaded:n #1 {p,T,F,TF} { \cs_if_exist:cTF {ver@#1.sty} { \prg_return_true: } { \cs_if_exist:cTF {ver@lwarp-#1.sty} { \prg_return_true: } { \prg_return_false: } } } \hook_gput_code:nnn {begindocument/end} {chemmacros} { \bool_set_false:N \l__chemmacros_hyperref_bool } \DeclareDocumentEnvironment{polymerdelims}{} {\begin{lateximage}[-chemmacros- polymer]} {\end{lateximage}} \DeclareDocumentEnvironment{redoxreaction}{m m} {\begin{lateximage}[-chemmacros- redoxreaction]} {\end{lateximage}} \AtBeginDocument{ \chemmacros_module_if_loaded:nTF{{acid-base}}{ \PackageInfo{lwarp}{Patching~chemmacros~module~acid-base} \VerifyCommand[lwarp][chemmacros]{\chemmacros_p:n} {D95080E9783CB80E34C51221236CF370} \cs_gset_protected:Npn \chemmacros_p:n #1 { \begingroup \boolfalse{mathjax} \LWR@subsingledollar*{ \textbackslash{}% p% \{% \LWR@HTMLsanitizedetokenized{\detokenize{#1}}% \} }{ chemmacrosp% \protect\LWR@HTMLsanitizedetokenized{\detokenize\expandafter{#1}}% }{ \group_begin: \mbox { \chemmacros_p_style:n {p} \ensuremath {#1} } \group_end: } \endgroup } \VerifyCommand[lwarp][chemmacros]{\pH} {89B9008750937C7614F2A5204D5DDD16} \RenewDocumentCommand \pH {} { \begingroup \boolfalse{mathjax} \LWR@subsingledollar*{\textbackslash{}pH}{chemmacros}{ \chemmacros_p:n { \chemmacros_formula:n {H} } } \endgroup } \VerifyCommand[lwarp][chemmacros]{\pOH} {3193E23422822579C0D2B2C10371BF84} \RenewDocumentCommand \pOH {} { \begingroup \boolfalse{mathjax} \LWR@subsingledollar*{\textbackslash{}pOH}{chemmacros}{ \chemmacros_p:n { \chemmacros_formula:n {OH} } } \endgroup } \VerifyCommand[lwarp][chemmacros]{\pKa} {C4141E480C360A8EDAE38B65F71F5B1F} \RenewDocumentCommand \pKa {O{}} { \begingroup \boolfalse{mathjax} \LWR@subsingledollar*{\textbackslash{}pKa{[}#1{]}}{chemmacros #1}{ \chemmacros_p:n { \Ka \ifblank {#1} {} { {} \c_math_subscript_token { \chemmacros_bold:n {#1} } } } } \endgroup } \VerifyCommand[lwarp][chemmacros]{\pKb} {00A20E25465C2E0D2E3731634F39B0FA} \RenewDocumentCommand \pKb {O{}} { \begingroup \boolfalse{mathjax} \LWR@subsingledollar*{\textbackslash{}pKb{[}#1{]}}{chemmacros #1}{ \chemmacros_p:n { \Kb \ifblank {#1} {} { {} \c_math_subscript_token { \chemmacros_bold:n {#1} } } } } \endgroup } \LetLtxMacro\LWR@chemmacros@origKa\Ka \renewcommand*{\Ka}{% \begingroup \boolfalse{mathjax} \LWR@subsingledollar*{\textbackslash{}Ka}{chemmacros}{% \LWR@chemmacros@origKa% }% \endgroup } \LetLtxMacro\LWR@chemmacros@origKb\Kb \renewcommand*{\Kb}{% \begingroup \boolfalse{mathjax} \LWR@subsingledollar*{\textbackslash{}Kb}{chemmacros}{% \LWR@chemmacros@origKb% }% \endgroup } \LetLtxMacro\LWR@chemmacros@origKw\Kw \renewcommand*{\Kw}{% \begingroup \boolfalse{mathjax} \LWR@subsingledollar*{\textbackslash{}Kw}{chemmacros}{ \LWR@chemmacros@origKw } \endgroup } }{}% module loaded }% AtBeginDocument \AtBeginDocument{ \chemmacros_module_if_loaded:nTF{{charges}}{ \PackageInfo{lwarp}{Patching~chemmacros~module~charges} \VerifyCommand[lwarp][chemmacros]{\fplus} {F6F7137115BC798D4CA779782DCCEB6D} \cs_gset_protected:Npn \fplus { \begingroup \boolfalse{mathjax} \LWR@subsingledollar*{\textbackslash{}fplus}{chemmacros} { \LWR@origensuredmath{\chemformula_fplus:} } \endgroup } \VerifyCommand[lwarp][chemmacros]{\fminus} {A7ED8520C49A794F33AA6122E2411746} \cs_gset_protected:Npn \fminus { \begingroup \boolfalse{mathjax} \LWR@subsingledollar*{\textbackslash{}fminus}{chemmacros} { \LWR@origensuredmath{\chemformula_fminus:} } \endgroup } }{}% Module loaded. }% AtBeginDocument \AtBeginDocument{ \chemmacros_module_if_loaded:nTF{{nomenclature}}{ \PackageInfo{lwarp}{Patching~chemmacros~module~nomenclature} \VerifyCommand[lwarp][chemmacros]{\chemmacros_charge:n} {258D97BF6FF3FA5C995D4FDCC44B0E63} \cs_gset_protected:Npn \chemmacros_charge:n #1 { \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0} {\chemmacros_formula:n { {}^{#1} }} { \ifmmode {\chemmacros_formula:n { {}^{#1} }} \else { \textsuperscript{\ensuremath{#1}} } \fi } } \hook_gput_code:nnn {begindocument/end} {chemmacros} { \protected\def\LWR@HTML@chemprime { \HTMLunicode{2032} } \LWR@formatted{chemprime} } \VerifyCommand[lwarp][chemmacros]{\chemmacros_cip:n} {EEF7D8AF4D975C2D11D879A77ABDFF88} \cs_gset_protected:Npn \__chemmacros_cip:n #1 { \tl_set:Nn \l__chemmacros_tmpa_tl {#1} \int_step_inline:nnnn {0} {1} {9} { \tl_replace_all:Nnn \l__chemmacros_tmpa_tl {##1} { { \l__chemmacros_cip_number_tl ##1} } } { \l__chemmacros_cip_inner_tl \LWR@textcurrentcolor{\LWR@textcurrentfont{% lwarp \l__chemmacros_tmpa_tl }}% lwarp } } \VerifyCommand[lwarp][chemmacros]{\Sconf} {D7A87543D1C944168CBAC59E9F45DF9A} \RenewDocumentCommand \Sconf { O{S} } { \begin{lateximage}[\textbackslash{}Sconf{[}#1{]}]* \chemmacros_sconf:n {#1} \end{lateximage} } \VerifyCommand[lwarp][chemmacros]{\Rconf} {AB922016338B2F2C2635E6104311DAF2} \RenewDocumentCommand \Rconf { O{R} } { \begin{lateximage}[\textbackslash{}Rconf{[}#1{]}]* \chemmacros_rconf:n {#1} \end{lateximage} } \VerifyCommand[lwarp][chemmacros]{\chemmacros_hapto:n} {FCEEDAB3292A95E65B69F4F8C8849B26} \cs_gset_protected:Npn \chemmacros_hapto:n #1 { \begingroup \boolfalse{mathjax} \LWR@subsingledollar*{\textbackslash{}hapto\{#1\}}{chemmacros}{ \chemmacros_coordination_symbol:nnnn { \l__chemmacros_coord_use_hyphen_bool } { { \c_true_bool } } { \chemeta } {#1} } \endgroup } \VerifyCommand[lwarp][chemmacros]{\chemmacros_dento:n} {E85BBDEF5A35F37215EBAD87AFCB99E8} \cs_gset_protected:Npn \chemmacros_dento:n #1 { \begingroup \boolfalse{mathjax} \LWR@subsingledollar*{\textbackslash{}dento\{#1\}}{chemmacros}{ \chemmacros_coordination_symbol:nnnn { \l__chemmacros_coord_use_hyphen_bool } { { \c_true_bool } } { \chemkappa } {#1} } \endgroup } \VerifyCommand[lwarp][chemmacros]{\chemmacros_bridge:n} {5E5D0EA9045A41FF30D4AB315E547B25} \cs_gset_protected:Npn \chemmacros_bridge:n #1 { \begingroup \boolfalse{mathjax} \LWR@subsingledollar*{\textbackslash{}bridge\{#1\}}{chemmacros}{ \chemmacros_coordination_symbol:nnnn { \l__chemmacros_coord_use_hyphen_bool } { \l__chemmacros_bridge_super_bool } { \chemmu } {#1} } \endgroup } }{}% Module loaded. }% AtBeginDocument \AtBeginDocument{ \chemmacros_module_if_loaded:nTF{{particles}}{ \PackageInfo{lwarp}{Patching~chemmacros~module~particles} \VerifyCommand[lwarp][chemmacros]{\chemmacros_declare_nucleophile:Nn} {ED9AA7471C8638CEF0757A10A2E3935E} \cs_gset_protected:Npn \chemmacros_declare_nucleophile:Nn #1#2 { \cs_set_protected:cpn {__chemmacros_ \chemmacros_remove_backslash:N #1:} { \bool_if:NTF \l__chemmacros_nucleophile_elpair_bool { \chemmacros_elpair:n { #2 } { \skip_horizontal:N \l__chemmacros_nucleophile_dim } \chemmacros_formula:n { {}^{-} } } { \chemmacros_formula:n { #2^{-} } } } \DeclareDocumentCommand #1 {o} {% \begin{lateximage}% \group_begin:% \IfNoValueF {##1}% { \chemmacros_set_keys:nn {particles} {##1} }% \use:c {__chemmacros_ \chemmacros_remove_backslash:N #1:}% \group_end:% \end{lateximage}% } } \RenewChemNucleophile \Nuc {Nu} \RenewChemNucleophile \ba {ba} }{}% Module loaded. }% AtBeginDocument \AtBeginDocument{ \chemmacros_module_if_loaded:nTF{{phases}}{ \PackageInfo{lwarp}{Patching~chemmacros~module~phases} \VerifyCommand[lwarp][chemmacros]{\chemmacros_phase:n} {83788F1FCBEDA21B495E919E36DD90A5} \cs_undefine:N \chemmacros_phase:n \cs_new_protected:Npn \chemmacros_phase:n #1 { \mode_leave_vertical: \bool_if:NTF \l__chemmacros_phases_sub_bool { \ifnumequal{\value{LWR@lateximagedepth}}{0} { \textsubscript{ (#1) } } { \chemformula_subscript:n { (#1) } } } { \skip_horizontal:N \l__chemmacros_phases_space_dim \chemmacros_text:n { (#1) } } } }{}% Module loaded. }% AtBeginDocument \AtBeginDocument{ \chemmacros_module_if_loaded:nTF{{mechanisms}}{ \PackageInfo{lwarp}{Patching~chemmacros~module~mechanisms} \chemmacros_define_keys:nn {textmechanisms} { type .choice: , type / .code:n = { \__chemmacros_set_mechanisms:nnn { S } { \textsubscript{N} } { } } , type / 1 .code:n = { \__chemmacros_set_mechanisms:nnn { S } { \textsubscript{N} 1 } { } } , type / 2 .code:n = { \__chemmacros_set_mechanisms:nnn { S } { \textsubscript{N} 2 } { } } , type / se .code:n = { \__chemmacros_set_mechanisms:nnn { S } { \textsubscript{E} } { } } , type / 1e .code:n = { \__chemmacros_set_mechanisms:nnn { S } { \textsubscript{E} 1 } { } } , type / 2e .code:n = { \__chemmacros_set_mechanisms:nnn { S } { \textsubscript{E} 2 } { } } , type / ar .code:n = { \__chemmacros_set_mechanisms:nnn { S } { \textsubscript{E} } { Ar - } } , type / e .code:n = { \__chemmacros_set_mechanisms:nnn { E } { } { } } , type / e1 .code:n = { \__chemmacros_set_mechanisms:nnn { E } { 1 } { } } , type / e2 .code:n = { \__chemmacros_set_mechanisms:nnn { E } { 2 } { } } , type / cb .code:n = { \__chemmacros_set_mechanisms:nnn { E } { 1 \textsubscript{cb} } { } } , type .default:n = } \VerifyCommand[lwarp][chemmacros]{\chemmacros_mechanisms:n} {2CF049E0C61235166A36565979D79933} \cs_gset_protected:Npn \chemmacros_mechanisms:n #1 { \tl_if_blank:nTF {#1} { \chemmacros_set_keys:nn {textmechanisms} { type } } { \chemmacros_set_keys:nn {textmechanisms} { type = #1 } } \mbox { \tl_use:N \l__chemmacros_mechanisms_ar_tl \tl_use:N \l__chemmacros_mechanisms_type_tl \tl_use:N \l__chemmacros_mechanisms_mol_tl } } \appto\LWR@restoreorigformatting{% \cs_set_protected:Npn \chemmacros_mechanisms:n #1% {% \tl_if_blank:nTF {#1}% { \chemmacros_set_keys:nn {mechanisms} { type } }% { \chemmacros_set_keys:nn {mechanisms} { type = #1 } }% \mbox% {% \tl_use:N \l__chemmacros_mechanisms_ar_tl% \tl_use:N \l__chemmacros_mechanisms_type_tl% \tl_use:N \l__chemmacros_mechanisms_mol_tl% }% }% } }{}% Module loaded. }% AtBeginDocument \AtBeginDocument{ \chemmacros_module_if_loaded:nTF{{newman}}{ \PackageInfo{lwarp}{Patching~chemmacros~module~newman} \VerifyCommand[lwarp][chemmacros]{\newman} {45E815D161E8467A51F5B04150DEC20C} \RenewDocumentCommand \newman {od()m}% { \IfValueTF{#2} {\begin{lateximage}[\textbackslash{}newman(#2)\{#3\}]*} {\begin{lateximage}[\textbackslash{}newman\{#3\}]*} \group_begin: \IfNoValueF {#1} { \chemmacros_set_keys:nn {newman} {#1} } \IfNoValueTF {#2} { \chemmacros_newman:nn { } {#3} } { \chemmacros_newman:nn {#2} {#3} } \group_end: \end{lateximage} }% }{}% Module loaded. }% AtBeginDocument \AtBeginDocument{ \chemmacros_module_if_loaded:nTF{{orbital}}{ \PackageInfo{lwarp}{Patching~chemmacros~module~orbital} \VerifyCommand[lwarp][chemmacros]{\orbital} {F8E338F96B2EBF6AFE4A91D37A58CD90} \RenewDocumentCommand \orbital {om} { \IfValueTF{#1} { \begin{lateximage}[% \textbackslash{}% orbital{[}% \LWR@HTMLsanitizedetokenized{\detokenize{#1}}% {]}\{#2\}% ]*[][margin-left: 1em ; margin-right: 1em] } { \begin{lateximage}[% \textbackslash{}orbital\{#2\}% ]*[][margin-left: 1em ; margin-right: 1em] } \group_begin: \chemmacros_set_keys:nn {orbital/type} {#2} \IfNoValueTF {#1} { \chemmacros_orbital:n { } } { \chemmacros_orbital:n {#1} } \group_end: \end{lateximage} } }{}% Module loaded. }% AtBeginDocument \AtBeginDocument{ \chemmacros_module_if_loaded:nTF{{reactions}}{ \PackageInfo{lwarp}{Patching~chemmacros~module~reactions} \VerifyCommand[lwarp][chemmacros]{\__chemmacros_declare_reaction_env:nnnn} {E52CE623404E664FD0647E3A874F2702} \cs_gset_protected:Npn \__chemmacros_declare_reaction_env:nnnn #1#2#3#4 { \exp_args:Nnx \DeclareDocumentEnvironment {#1} { \int_compare:nT { #3+0 = 0 } {!} O{} \prg_replicate:nn {#3+0} {m} } { \boolfalse{mathjax}% lwarp \ifdefvoid{\LWR@ThisAltText}{% lwarp \ThisAltText{-chemmacros-~reaction}% lwarp }{}% lwarp \chemmacros_add_reaction_description:n {##1} \__chemmacros_begin_reaction: \__chemmacros_reaction_read:nnw {#2} {#4} } { \__chemmacros_end_reaction: \gdef\LWR@ThisAltText{}% lwarp \ignorespacesafterend } } \cs_generate_variant:Nn \chemmacros_declare_reaction_env:nnnn {nnnV} \RenewChemReaction {reaction} {equation} \RenewChemReaction {reaction*} {equation*} \RenewChemReaction {reactions} {align} \RenewChemReaction {reactions*} {align*} }{}% Module loaded. }% AtBeginDocument \VerifyCommand[lwarp][chemmacros]{\printreactants} {18AD32DCD3F2F49C0369DA9ED9974CD7} \StartDefiningTabulars% lwarp \RenewDocumentCommand \printreactants {s} { \group_begin: \chemmacros_set_keys:nn {reactants} { switch = false } \int_step_variable:nNn { \seq_count:N \g_chemnum_initiated_compounds_seq } \l__chemmacros_reactants_tmpa_tl { \seq_put_right:Nx \l__chemmacros_reactants_tmpa_seq { \chemnum_cmpd:nnne { \c_false_bool } { \c_true_bool } {} { \seq_item:NV \g_chemnum_initiated_compounds_seq \l__chemmacros_reactants_tmpa_tl } & \bool_if:nT {#1} { \seq_item:NV \g_chemnum_initiated_compounds_seq \l__chemmacros_reactants_tmpa_tl & } % TODO: expl3-command ?? \solvent { \seq_item:NV \g_chemnum_initiated_compounds_seq \l__chemmacros_reactants_tmpa_tl } \tabularnewline } \tl_set:Nx \l__chemmacros_reactants_tmpb_tl { \seq_item:NV \g_chemnum_initiated_compounds_seq \l__chemmacros_reactants_tmpa_tl } \chemmacros_reactants_list_subreactant:Vn \l__chemmacros_reactants_tmpb_tl {#1} } % TODO: longtable ? % table customizable? % first draft of two styles \par \noindent \bool_if:NTF \l__chemmacros_reactants_printreactants_style_bool { \str_case:Vn \l__chemmacros_reactants_printreactants_style_str { {xltabular} { \chemmacros_if_package_loaded:nTF {xltabular} { \bool_if:nTF {#1} { \begin {xltabular} { \textwidth } { @{}ll>{\raggedright\arraybackslash}X@{} } } { \begin {xltabular} { \textwidth } { @{}l>{\raggedright\arraybackslash}X@{} } } \seq_use:Nn \l__chemmacros_reactants_tmpa_seq { } \end{xltabular} } { \msg_expandable_error:nnnn {chemmacros} {package-not-loaded} { \printreactants } {xltabular} } } {longtable} { \chemmacros_if_package_loaded:nTF {longtable} { \bool_if:nTF {#1} { \begin {longtable}[l] { @{}ll>{\raggedright\arraybackslash}p{0.6\textwidth}@{} } } { \begin {longtable}[l] { @{}l>{\raggedright\arraybackslash}p{0.9\textwidth}@{} } } \seq_use:Nn \l__chemmacros_reactants_tmpa_seq { } \end{longtable} } { \msg_expandable_error:nnnn {chemmacros} {package-not-loaded} { \printreactants } {longtable} } } } } { \msg_warning:nn {chemmacros} {missing-printreactants-style} } \group_end: } \VerifyCommand[lwarp][chemmacros]{\chemmacros_reactants_list_subreactant:nn} {50553A53C2149BD3ADA8AE0FAB0C79C4} \cs_gset_protected:Npn \chemmacros_reactants_list_subreactant:nn #1#2 { \chemnum_if_subcompounds:nT {#1} { \int_step_variable:nNn { \chemnum_count_subcompounds:n {#1} } \l__chemmacros_reactants_tmpa_tl { \seq_put_right:Nx \l__chemmacros_reactants_tmpa_seq { \chemnum_cmpd:nnne { \c_false_bool } { \c_true_bool } {} { \exp_not:n {#1} \exp_not:V \l_chemnum_compound_separator_tl \chemnum_get_subcompound:nV {#1} \l__chemmacros_reactants_tmpa_tl } & \bool_if:nT {#2} { #1 \l_chemnum_compound_separator_tl \chemnum_get_subcompound:nV {#1} \l__chemmacros_reactants_tmpa_tl & } % TODO: expl3-command ?? \solvent { #1 \l_chemnum_compound_separator_tl \chemnum_get_subcompound:nV {#1} \l__chemmacros_reactants_tmpa_tl } \tabularnewline } } } } \cs_generate_variant:Nn \chemmacros_reactants_list_subreactant:nn {V} \StopDefiningTabulars% lwarp \AtBeginDocument{ \chemmacros_module_if_loaded:nTF{{redox}}{ \PackageInfo{lwarp}{Patching~chemmacros~module~redox} \NewDocumentCommand \LWR@chemmacros@ox { s m >{\SplitArgument{1}{,}}m } { \IfBooleanTF {#1} { \chemmacros_ox:nnnn {#1} {#2} #3 } { \chemmacros_ox:nnnn { } {#2} #3 } } \VerifyCommand[lwarp][chemmacros]{\ox} {06B84CC6B38302F75169D5B90D8D29AA} \RenewDocumentCommand \ox { s O{} m } { \begingroup \boolfalse{mathjax} \IfBooleanTF {#1} { \LWR@subsingledollar*{% yes hash \textbackslash{}% ox*% \{% \LWR@HTMLsanitizedetokenized{\detokenize{#3}}% \}% alt }{% star \protect\LWR@HTMLsanitizedetokenized{\detokenize\expandafter{#2}}% }{% \LWR@chemmacros@ox* {#2} {#3}% contents }% } { \LWR@subsingledollar*{% yes hash \textbackslash{}% ox% \{% \LWR@HTMLsanitizedetokenized{\detokenize{#3}}% \}% alt }{% \protect\LWR@HTMLsanitizedetokenized{\detokenize\expandafter{#2}}% }{% \LWR@chemmacros@ox {#2} {#3}% contents }% } \endgroup } }{}% Module loaded. }% AtBeginDocument \AtBeginDocument{ \chemmacros_module_if_loaded:nTF{{scheme}}{ \PackageInfo{lwarp}{Patching~chemmacros~module~scheme} \ifdefstring{\schemename}{los}{ \SetupFloatingEnvironment{scheme}{ name = \chemmacros_translate:n {scheme-name} } }{} }{}% Module loaded. }% AtBeginDocument \AtBeginDocument{ \chemmacros_module_if_loaded:nTF{{spectroscopy}}{ \PackageInfo{lwarp}{Patching~chemmacros~module~spectroscopy} \VerifyCommand[lwarp][chemmacros]{\__chemmacros_nmr_base:nn} {EDE669CC90B085080E3F96DB754836D5} \cs_gset_protected:Npn \__chemmacros_nmr_base:nn #1#2 { \group_begin: \tl_use:N \l__chemmacros_nmr_base_format_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 {#2} \textsuperscript{#1} \tl_if_blank:VF \g__chemmacros_nmr_element_coupled_tl { \bool_if:NTF \l__chemmacros_nmr_parse_bool { \chemformula_ch:nV {} \g__chemmacros_nmr_element_coupled_tl } { \chemmacros_formula:V \g__chemmacros_nmr_element_coupled_tl } } \tl_use:N \l__chemmacros_nmr_element_method_connector_tl \tl_use:N \l__chemmacros_nmr_method_tl \group_end: } \VerifyCommand[lwarp][chemmacros]{\chemmacros_nmr_position:n} {637FDE0E801CF4052274FF60A12A38F0} \cs_gset_protected:Npn \chemmacros_nmr_position:n #1 { \chemmacros_formula:x { \exp_not:V \g__chemmacros_nmr_element_tl \bool_if:NF \l__chemmacros_nmr_position_side_bool { \tl_if_eq:NnTF \l__chemmacros_nmr_position_tl {^}% lwarp { \textsuperscript{\exp_not:n { {#1} }} }% lwarp { \textsubscript{\exp_not:n { {#1} }} }% lwarp } } \bool_if:NT \l__chemmacros_nmr_position_side_bool { \tl_use:N \l__chemmacros_nmr_position_tl \__chemmacros_nmr_position:n {#1} } } \VerifyCommand[lwarp][chemmacros]{\__chemmacros_nmr_coupling:w} {4D1E7321CA2F8C7EA2E4F56FB3A26EED} \cs_gset_protected:Npn \__chemmacros_nmr_coupling:w (#1;#2) { \tl_set:Nn \l__chemmacros_nmr_coupling_bonds_tl { \l__chemmacros_nmr_coupling_bonds_pre_tl #1 \l__chemmacros_nmr_coupling_bonds_post_tl } \bool_if:NTF \l__chemmacros_nmr_coupling_nuclei_sub_bool { \tl_set:Nn \l__chemmacros_nmr_coupling_nuclei_tl { \textsubscript% lwarp { \l__chemmacros_nmr_coupling_nuclei_pre_tl \chemmacros_formula:n {#2} \l__chemmacros_nmr_coupling_nuclei_post_tl } } } { \tl_set:Nn \l__chemmacros_nmr_coupling_nuclei_tl { \l__chemmacros_nmr_coupling_nuclei_pre_tl \chemmacros_formula:n {#2} \l__chemmacros_nmr_coupling_nuclei_post_tl } } \__chemmacros_nmr_coupling_aux_i:w } \AfterEndPreamble{% After \AtBeginDocument \VerifyCommand[lwarp][chemmacros]{\chemmacros_nmr:nnnn} {FD67505420F044B2CA8E7CBD05B1ECEB} \cs_gset_protected:Npn \chemmacros_nmr:nnnn #1#2#3#4 { \bool_if:NT \l__chemmacros_nmr_list_bool { \item \scan_stop: } \group_begin: \mode_leave_vertical: \bool_set_false:N \l__chemmacros_nmr_frequency_bool \bool_set_false:N \l__chemmacros_nmr_solvent_bool \tl_if_empty:nF {#3} { \bool_set_true:N \l__chemmacros_nmr_frequency_bool } \tl_if_empty:nF {#4} { \bool_set_true:N \l__chemmacros_nmr_solvent_bool } \bool_if:nT { \l__chemmacros_nmr_frequency_bool || \l__chemmacros_nmr_solvent_bool } { \bool_set_true:N \l__chemmacros_nmr_delimiters_bool } \bool_if:nT { \l__chemmacros_nmr_frequency_bool && \l__chemmacros_nmr_solvent_bool } { \bool_set_true:N \l__chemmacros_nmr_comma_bool } \tl_if_empty:nTF {#2} { \__chemmacros_nmr_nucleus:VV \l__chemmacros_nmr_isotope_default_tl \l__chemmacros_nmr_element_default_tl } { \__chemmacros_nmr_nucleus:w #2 \q_stop } \mode_if_math:TF { \text { \group_begin: \tl_use:N \l__chemmacros_nmr_format_tl \LWR@textcurrentcolor{\LWR@textcurrentfont{% lwarp \__chemmacros_nmr_base:VV \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 { \__chemmacros_nmr_frequency:n {#3} } \bool_if:NT \l__chemmacros_nmr_comma_bool { , ~ } \bool_if:NT \l__chemmacros_nmr_solvent_bool { \chemmacros_formula:n {#4} } \bool_if:NT \l__chemmacros_nmr_delimiters_bool { ) } \tl_if_blank:nT {#1} {:~} }}% lwarp \group_end: } \tl_if_blank:nT {#1} { \delta \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 \LWR@textcurrentcolor{\LWR@textcurrentfont{% lwarp \__chemmacros_nmr_base:VV \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 { \__chemmacros_nmr_frequency:n {#3} } \bool_if:NT \l__chemmacros_nmr_comma_bool {,~} \bool_if:NT \l__chemmacros_nmr_solvent_bool { \bool_if:NTF \l__chemmacros_nmr_parse_bool {\ch{#4}}% lwarp {#4} } \bool_if:NT \l__chemmacros_nmr_delimiters_bool {)} }}% lwarp \tl_if_blank:nT {#1} {:} \group_end: \tl_if_blank:nT {#1} { \tl_use:N \c_space_tl \c_math_toggle_token \delta \c_math_toggle_token \l__chemmacros_nmr_delta_tl \bool_if:NT \l__chemmacros_nmr_use_equal_bool {~=} } } \group_end: } }% AfterEndPremble \VerifyCommand[lwarp][chemmacros]{\chemmacros_data:w} {30A6134DE00E9850E074854B48644833} \RenewDocumentCommand \chemmacros_data:w { smo } { \bool_if:NT \l__chemmacros_nmr_list_bool { \item } { \tl_use:N \l__chemmacros_nmr_format_tl \LWR@textcurrentcolor{\LWR@textcurrentfont{% lwarp #2 \IfNoValueF {#3} { ~ ( #3 ) } \IfBooleanT {#1} { \bool_if:NT \l__chemmacros_nmr_use_equal_bool { : } } }}% lwarp } \IfBooleanF {#1} { \bool_if:NT \l__chemmacros_nmr_use_equal_bool { ~ = } } } }{}% Module loaded. }% AtBeginDocument \AtBeginDocument{ \chemmacros_module_if_loaded:nTF{{thermodynamics}}{ \PackageInfo{lwarp}{Patching~chemmacros~module~thermodynamics} \VerifyCommand[lwarp][chemmacros]{\chemmacros_state:nnnnnn} {C5B35D9405E380ABE9A9CE849F46EE6D} \cs_gset_protected:Npn \chemmacros_state:nnnnnn #1#2#3#4#5#6 { \group_begin: \chemmacros_set_keys:ne {thermodynamics} { \exp_not:n {#1} , \tl_if_novalue:nF {#2} { subscript-left = \exp_not:n {#2} , } \tl_if_novalue:nF {#3} { superscript-left = \exp_not:n {#3} , } \tl_if_novalue:nF {#5} { subscript-right = \exp_not:n {#5} , } \tl_if_novalue:nF {#6} { superscript-right = \exp_not:n {#6} } } \LWR@subsingledollar*{% yes hashing \textbackslash{}state% \{\LWR@HTMLsanitizedetokenized{\detokenize{#4}}\}% alt }{% chemmacros_state% add'l hashing #1% options LSP \tl_use:N \l__chemmacros_state_sp_left_tl% super/subscripts LSB \tl_use:N \l__chemmacros_state_sb_left_tl RSP \tl_use:N \l__chemmacros_state_sp_right_tl RSB \tl_use:N \l__chemmacros_state_sb_right_tl } { \LWR@origensuredmath { \chemmacros_text:V \l__chemmacros_state_pre_tl \c_math_superscript_token { \chemmacros_text:V \l__chemmacros_state_sp_left_tl } \tl_if_empty:NTF \l__chemmacros_state_sb_left_tl {} { \c_math_subscript_token { \chemmacros_text:V \l__chemmacros_state_sb_left_tl } } #4 \c_math_superscript_token { \chemmacros_text:V \l__chemmacros_state_sp_right_tl } \tl_if_empty:NTF \l__chemmacros_state_sb_right_tl {} { \c_math_subscript_token { \chemmacros_text:V \l__chemmacros_state_sb_right_tl } } \chemmacros_text:V \l__chemmacros_state_post_tl } } \group_end: } \cs_generate_variant:Nn \chemmacros_state:nnnnnn { nVVVVV } \VerifyCommand[lwarp][chemmacros]{\chemmacros_declare_state:Nn} {3C1386935B85ED732A283627DA403FBE} \cs_gset_protected:Npn \chemmacros_declare_state:Nn #1#2 { \chemmacros_define_keys:xn {thermodynamics/\chemmacros_remove_backslash:N #1} { pre .meta:nn = {chemmacros/thermodynamics} { pre = ##1 } , post .meta:nn = {chemmacros/thermodynamics} { post = ##1 } , superscript-left .meta:nn = {chemmacros/thermodynamics} { superscript-left = ##1 } , superscript-right .meta:nn = {chemmacros/thermodynamics} { superscript-right = ##1 } , superscript .meta:n = { superscript-right = ##1 } , subscript-left .meta:nn = {chemmacros/thermodynamics} { subscript-left = ##1 } , subscript-right .meta:nn = {chemmacros/thermodynamics} { subscript-right = ##1 } , subscript .meta:n = { subscript-left = ##1 } , subscript-pos .choices:nn = { left , right } { \tl_set_eq:NN \l__chemmacros_state_sb_pos_tl \l_keys_choice_tl } , symbol .tl_set:N = \l__chemmacros_state_symbol_tl , unit .tl_set:N = \l__chemmacros_state_unit_tl } \DeclareDocumentCommand #1 { sO{}D(){}m } { \group_begin: \chemmacros_set_keys:en {thermodynamics/\chemmacros_remove_backslash:N #1} {#2} \tl_if_blank:nF {##3} { \chemmacros_set_keys:ne {thermodynamics} { subscript-\l__chemmacros_state_sb_pos_tl = \exp_not:n {##3} } } \chemmacros_state:nVVVVV {##2} \c_novalue_tl \c_novalue_tl \l__chemmacros_state_symbol_tl \c_novalue_tl \c_novalue_tl \chemmacros_set_keys_groups:nnn {thermodynamics} {variables} {##2} \IfBooleanF {##1} { = \qty {##4} { \l__chemmacros_state_unit_tl } } \group_end: } } \RenewChemState \enthalpy { symbol = H , unit = \kilo\joule\per\mole } \RenewChemState \entropy { symbol = S , unit = \joule\per\kelvin\per\mole , pre = } \RenewChemState \gibbs { symbol = G , unit = \kilo\joule\per\mole } }{}% Module loaded. }% AtBeginDocument \ExplSyntaxOff \endinput %% %% End of file `lwarp-chemmacros.sty'.