chemmacros에서 결합 상수의 조판을 재현하는 방법

chemmacros에서 결합 상수의 조판을 재현하는 방법

나는 실험 데이터를 조판하기 위해 libertinenewtxmath와 패키지 beramono와 함께 글꼴을 사용하고 있습니다 . chammacros이것은 매우 잘 작동하며 원하는 결과를 얻습니다. 이 패키지는 규정이 문자 J에 매우 가까운 방식으로 결합 상수를 조판합니다. 동일한 결과 텍스트를 얻으려고 할 때 mathtoolsof와 같은 패키지를 사용하고 있지만 leftidx내 요구 사항을 충족하지 못 하더라도 실패합니다. 표준 버전이 필요합니다.

여기 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}

chemmacros나는 문서에서 기억하는 것을 내부적으로 사용하고 있다고 생각 mathtools하지만 분명히 나보다 더 똑똑한 방법입니다.

답변1

chemmacros는 다음을 위해 일반 수학 모드를 사용합니다 $^{1}J$. 공간을 약간 줄이는 수정된 버전이 있습니다 $^{1\!}J$.

여기에 이미지 설명을 입력하세요

아래에서는 v4.4를 사용하며, chemmacros다른 \!숫자를 조판하는 방법을 결정하는 기능을 사용하고 추가하므로(아래 예의 확장 옵션 참조) 더 이상 재정의가 필요하지 않습니다.

\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}[2014/01/29] % use version 4
\chemsetup[nmr]{
  delta = (ppm) ,
  pos-number = side ,
  use-equal,
  format = \bfseries,
  list=true ,
  coupling-pos-cs = \ensuremath , % <<< added
  atom-number-cs = \ensuremath    % <<< added
}
\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
}

\begin{document}

Good way:
\begin{experimental}
  \NMR(400)[C6D6] \val{2.01} (d, \J(1;CH)[Hz]{25.0}, \#{24}, \pos{5})
\end{experimental}
Same way:
$^{1\!}J$ coupling

\end{document}

관련 정보