I am using the fonts libertine
with newtxmath and beramono
together with the chammacros
package to typeset experimental data. This works very well and I get the desired results. This package manages to typeset the coupling constant in a way that its prescript is very close to the letter J. When I try to achieve the same result text, I fail, even though I am using packages like mathtools
of leftidx
but they don't meet my needs it their standard version.
Here is a MWE
\documentclass[a4paper,10pt,bibliography=totoc,listof=totoc]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{libertine}
\usepackage[scaled=.83]{beramono}
\usepackage[libertine]{newtxmath}
\usepackage{chemmacros}
\chemsetup[nmr]{
delta = (ppm) ,
pos-number = side ,
use-equal,
format = \bfseries,
list=true
}
\usepackage{siunitx}
\sisetup{
separate-uncertainty ,
per-mode = symbol ,
range-phrase = -- ,
detect-mode = false ,
detect-weight = true ,
mode = text ,
text-rm = \libertineLF % use libertine with lining figures
}
\ExplSyntaxOn
\cs_set_protected:Npn \__chemmacros_nmr_coupling:w (#1;#2)
{
\tl_set:Nn \l__chemmacros_nmr_coupling_bonds_tl { #1 \! }
\tl_set:Nn \l__chemmacros_nmr_coupling_nuclei_tl
{
\c_math_subscript_token
{ \chemmacros_chemformula:n { #2 } }
}
\__chemmacros_nmr_coupling_aux_i:w
}
\cs_set_protected:Npn \chemmacros_nmr_number:n #1
{
$ #1 $ \, % put the number in math-mode for lining figures
\chemmacros_atom:V \g__chemmacros_nmr_element_tl
}
\ExplSyntaxOff
\begin{document}
Good way:
\begin{experimental}
\NMR(400)[C6D6] \val{2.01} (d, \J(1;CH)[Hz]{25.0}, \#{24}, \pos{5})
\end{experimental}
Not so good way:
$\prescript{1}{}{J}$ coupling
\end{document}
I believe chemmacros
is using mathtools
internally from what I remember from the documentation, but appparently in a smarter way than I do.