3

I am using the chemmacros package to typeset the experimental data of my research report. However, the options provided as settings for the output don't fit my needs. I would like to have atom numbers of the nuclei as superscripts instead of using a dash or a subscript. However, in the documentation a could only find the options side and sub. Is there a way of setting a superscript position?

Currently I am using the following settings:

\documentclass[a4paper,10pt,bibliography=totoc,listof=totoc]{scrreprt}
\usepackage{chemmacros}
\usepackage{siunitx}
\chemsetup[nmr]{delta=(ppm),pos-number=side,use-equal,format = \bfseries,list=true}       
\sisetup{separate-uncertainty,per-mode=symbol,detect-all,range-phrase=--}

\begin{document}
\begin{experimental}

\NMR(600)[CDCl3] \val{2.01} (s, \#{24}, \pos{5}), \val{2.31} (s, \#{12},\pos{6})\\
\data{IR} ...

\end{experimental}
\end{document}

Any help or suggestions are greatly appreciated.

P.S. Is there a reason why the nmr option group is setting up the whole look of the experimental section? I was looking through the documentation for a more general option, but then found that this would do it.

5

Since 2014/01/24 (v4.3) chemmacros has the option pos-number=super:

\documentclass[a4paper,10pt,bibliography=totoc,listof=totoc]{scrreprt}
\usepackage[compatibility=newest]{chemmacros}
\usepackage{siunitx}

\chemsetup{
  modules = spectroscopy ,
  spectroscopy/delta=(ppm),
  spectroscopy/pos-number=super,% <<<<<<<<<
  spectroscopy/use-equal,
  spectroscopy/format = \bfseries,
  spectroscopy/list=true
} 
\sisetup{
  separate-uncertainty,
  per-mode=symbol,
  detect-all,
  range-phrase=--
}

\begin{document}

\begin{experimental}
  \NMR(600)[CDCl3] \val{2.01} (s, \#{24}, \pos{5}), \val{2.31} (s, \#{12},\pos{6})
  \data{IR} ...
\end{experimental}

\end{document}

original answer:

As you've noticed there is no option for this. You need to redefine \chemmacros_nmr_position:n. This should do what you want:

\documentclass[a4paper,10pt,bibliography=totoc,listof=totoc]{scrreprt}
\usepackage{chemmacros}
\usepackage{siunitx}
\chemsetup[nmr]{delta=(ppm),pos-number=side,use-equal,format = \bfseries,list=true} 
\sisetup{separate-uncertainty,per-mode=symbol,detect-all,range-phrase=--}

\ExplSyntaxOn
\cs_set_protected:Npn \chemmacros_nmr_position:n #1
  {
    \chemmacros_chemformula:x
      {
        \exp_not:V \g__chemmacros_nmr_element_tl
        \exp_not:n { ^{#1} }
      }
  }
\ExplSyntaxOff

\begin{document}
\begin{experimental}

\NMR(600)[CDCl3] \val{2.01} (s, \#{24}, \pos{5}), \val{2.31} (s, \#{12},\pos{6})\\
\data{IR} ...

\end{experimental}
\end{document}

enter image description here

To your PS: this has historical reasons. The \NMR command (and some of the options) existed before the experimental environment. When I added it all its options were grouped together in the nmr option group, too.

  • I'll add an option for this to the next release – clemens Jan 18 '14 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.