summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.spectroscopy.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.spectroscopy.code.tex')
-rw-r--r--Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.spectroscopy.code.tex40
1 files changed, 36 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.spectroscopy.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.spectroscopy.code.tex
index 2c543a8e494..8ba4c066cc6 100644
--- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.spectroscopy.code.tex
+++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.spectroscopy.code.tex
@@ -11,7 +11,7 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-% Copyright 2011-2016 Clemens Niederberger
+% Copyright 2011-2017 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -120,6 +120,7 @@
\tl_set:Nn \l__chemmacros_nmr_element_default_tl {#2}
}
+\ChemCompatibilityTo{5.7}
\cs_new_protected:Npn \__chemmacros_nmr_base:nn #1#2
{
\tl_if_blank:VF \g__chemmacros_nmr_element_coupled_tl
@@ -135,6 +136,36 @@
\tl_use:N \l__chemmacros_nmr_element_method_connector_tl
\tl_use:N \l__chemmacros_nmr_method_tl
}
+\EndChemCompatibility
+\ChemCompatibilityFrom{5.8}
+\tl_new:N \l__chemmacros_nmr_base_format_tl
+
+\chemmacros_define_keys:nn {spectroscopy}
+ { nmr-base-format .tl_set:N = \l__chemmacros_nmr_base_format_tl }
+
+\cs_new_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}
+ \chemmacros_chemformula:n { ^{#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_chemformula: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:
+ }
+\EndChemCompatibility
+
\cs_generate_variant:Nn \__chemmacros_nmr_base:nn { VV }
\cs_new_protected:Npn \__chemmacros_nmr_frequency:n #1
@@ -191,7 +222,7 @@
\l__chemmacros_nmr_coupling_symbol_tl ,
atom-number-cs .code:n =
\cs_set_eq:NN \__chemmacros_nmr_number:n #1 ,
- \chemmacros_if_compatiblity:nnT {>=} {5.3}
+ \chemmacros_if_compatibility:nnT {>=} {5.3}
{ atom-number-space .skip_set:N = \l__chemmacros_nmr_space_skip , }
coupling-pos-cs .code:n =
\cs_set_eq:NN \__chemmacros_nmr_position:n #1 ,
@@ -209,11 +240,11 @@
{
\cs_if_exist:NTF #1
{
- \RenewDocumentCommand #1 { s }
+ \RenewDocumentCommand #1 {s}
{ \IfBooleanTF {##1} { \NMR*{#2} } { \NMR{#2} } }
}
{
- \NewDocumentCommand #1 { s }
+ \NewDocumentCommand #1 {s}
{ \IfBooleanTF {##1} { \NMR*{#2} } { \NMR{#2} } }
}
}
@@ -476,3 +507,4 @@
% --------------------------------------------------------------------------
\tex_endinput:D
2015/12/31 - new option `atom-number-space'
+2017/01/27 - new option `nmr-base-format'