所以我可以让它工作;
\documentclass{minimal}
\usepackage{isotope}
\begin{document}
\isotope{Po} --- \isotope[56]{Fe} --- \isotope[13][6]{C}\\
$\isotope{n} + \isotope{H} \to \isotope{D} +
\gamma(2.2\,\mathrm{MeV})$ \\
$\isotope[13]{C} + \alpha(5.314\,\mathrm{MeV}) \to
\isotope[16]{O}^{**} + n$
\end{document}
并显示和输出类似这样的内容;
但当我这样做时......
\documentclass{minimal}
\usepackage[compatibility=5.8]{chemmacros}
\chemsetup{modules=all}
\begin{document}
\isotope{Po} --- \isotope[56]{Fe} --- \isotope[13][6]{C}\\
$\isotope{n} + \isotope{H} \to \isotope{D} +
\gamma(2.2\,\mathrm{MeV})$ \\
$\isotope[13]{C} + \alpha(5.314\,\mathrm{MeV}) \to
\isotope[16]{O}^{**} + n$
\end{document}
一切都搞砸了。控制序列等错误。我把文档读了好几遍,非常确定我做的是对的。
! Missing number, treated as zero.
<to be read again>
\@elements@atom@name@num@[
l.6 \isotope{Po} --- \isotope[
56]{Fe} --- \isotope[13][6]{C}\\
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Missing \endcsname inserted.
<to be read again>
\__int_eval_end:
l.6 \isotope{Po} --- \isotope[
56]{Fe} --- \isotope[13][6]{C}\\
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing \endcsname inserted.
<to be read again>
\__int_to_roman_
l.6 \isotope{Po} --- \isotope[
56]{Fe} --- \isotope[13][6]{C}\\
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing number, treated as zero.
<to be read again>
\@elements@atom@name@num@[
l.6 \isotope{Po} --- \isotope[
56]{Fe} --- \isotope[13][6]{C}\\
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
答案1
我做了以下更改:
- 将文档类替换
minimal
为article
- 在整个代码中一致使用 chemmacros 语法,避免需要恢复到数学模式。使用
\isotope
fromchemmacros
从包中检索必要的同位素信息elements
。 - 由于中未设置
n
和,因此需要恢复使用语法。D
elements
chemformula
- 粒子(alpha 和 gamma)是使用
chemgreek
宏设置的。这样可以避免恢复到数学模式。标准用法是让希腊字母直立,这需要加载具有直立希腊字形的字体。为此,我加载了 Linux Libertine。 - 我改变了
\isotope
语法。它应该是\isotope{nuc,symbol}
,其中 nuc 是中子数(左上角的数字),symbol 是元素周期表中元素的符号。 - 粒子的能量值使用
siunitx
语法进行格式化。
这是 MWE:
\documentclass[a4paper,12pt]{article}
\usepackage{chemmacros}
\chemsetup{modules=all}
\usepackage{chemgreek}
\usepackage{fontspec}
\selectchemgreekmapping{fontspec}
\setmainfont{LinLibertine_R.otf} % for upright greek glyphs
\usepackage{siunitx}
\begin{document}
\isotope{Po} --- \isotope{56,Fe} --- \isotope{13,C}
\bigskip
\ch{^{1}n + \isotope{H} -> ^{2}_{1}D + \chemgamma}(\SI{2.2}{\meV})
\bigskip
\ch{\isotope{13,C} + \chemalpha}(\SI{5.314}{\meV}) \ch{-> \isotope{16,O}$^{**}$ + n}
\end{document}