我正在使用achemso
、chemmacros
和chemformula
来格式化论文。我使用coord-use-hyphen = true
中的选项编写了整个chemmacros
文档。但是,现在我遇到了一篇论文,它不适用,我想知道我是否必须重新做所有其他 .bib 条目。
最简单的方法似乎是创建一个\haptonohypen{}
类似的命令\hapto{}
,但无论coord-use-hyphen
设置为何,它都不会生成连字符?
另一种方法是,如果我可以设置\iupac
一个条目的选项(类似于\iupac[coord-use-hyphen=true]{stuff here}
,但我不知道是否可能(我尝试过仅指定上述内容)。
下面是一个 MWE,其中包含我对其他 79 个 .bib 条目使用的选项:
\documentclass[journal=cgdefu]{achemso}
\AtBeginDocument{\let\latin\relax} %So chemarcos works woth achemso
\usepackage{chemmacros}
\chemsetup{
formula=chemformula, %use chemformula instead of say, mhchem
nomenclature/coord-use-hyphen=true, %Puts hypens after bridging and hapto
}
\begin{filecontents}{MWE.bib}
@article{Masci2005,
author = {Masci, Bernardo and Thu\'{e}ry, Pierre},
doi = {10.1016/j.poly.2004.11.002},
journal = {Polyhedron},
number = {2},
pages = {229--237},
title = {{Uranyl complexes with the pyridine-2,6-dicarboxylato ligand: new dinuclear species with \iupac{\bridge{}\hapto{2},\hapto{2}peroxide}, \iupac{\bridge{2}hydroxide} or \iupac{\bridge{2}methoxide bridges}}},
volume = {24},
year = {2005}
}
\end{filecontents}
\title{MWE}
\author{Canageek}
\affiliation{TeX.SX}
\email{Canageek}
\date{}
\begin{document}
This is a test text.\cite{Masci2005}
\bibliography{MWE}
\end{document}
答案1
从 v5.7 (2016/06/07) 开始(或者由于一些拼写错误而从 v5.7a 开始)chemmacros
使用函数
\chemmacros_coordination_symbol:nnnn
用于定义协调符号。通过它,可以轻松定义一个永远不会输出以下破折号的适合宏。
此外,从 v5.7 开始\iupac
有一个用于设置选项的可选参数,在这种情况下甚至可能是更好的选择:
\documentclass{article}
\usepackage{chemmacros}[2016/06/08] % v5.7a
\chemsetup{
formula = chemformula
}
\ExplSyntaxOn
\cs_new_protected:Npn \chemmacros_hapto_nohyp:n #1
{
\chemmacros_coordination_symbol:nnnn
{ \c_false_bool } % boolean: use hyphen or don't
{ \c_false_bool } % boolean: use superscript (true) or subscript (false)
{ \chemeta } % symbol
{#1} % sub-/superscript
}
\NewChemIUPAC \haptoNH { \chemmacros_hapto_nohyp:n }
\ExplSyntaxOff
\begin{document}
\hapto{2} \par
Option one: \haptoNH{2} \par
Option two: \iupac[coord-use-hyphen=false]{\hapto{2}}
\end{document}
答案2
您可以定义一个\haptonohyphen
命令:
\documentclass[journal=cgdefu]{achemso}
\AtBeginDocument{\let\latin\relax} %So chemarcos works woth achemso
\usepackage{chemmacros}
\chemsetup{
formula=chemformula, %use chemformula instead of say, mhchem
nomenclature/coord-use-hyphen=true, %Puts hypens after bridging and hapto
}
\ExplSyntaxOn
\NewChemIUPAC \haptonohyphen { \chemformula_hapto_nohyphen:n }
\cs_new_protected:Npn \chemformula_hapto_nohyphen:n #1
{
\chemeta \chemformula_superscript:n { #1 }
}
\ExplSyntaxOff
\begin{filecontents}{\jobname.bib}
@article{Masci2005,
author = {Masci, Bernardo and Thu\'{e}ry, Pierre},
doi = {10.1016/j.poly.2004.11.002},
journal = {Polyhedron},
number = {2},
pages = {229--237},
title = {{Uranyl complexes with the pyridine-2,6-dicarboxylato ligand:
new dinuclear species with \iupac{\bridge{}\haptonohyphen{2},\hapto{2}peroxide},
\iupac{\bridge{2}hydroxide} or \iupac{\bridge{2}methoxide bridges}}},
volume = {24},
year = {2005}
}
\end{filecontents}
\title{MWE}
\author{Canageek}
\affiliation{TeX.SX}
\email{Canageek}
\date{}
\begin{document}
This is a test text.\cite{Masci2005}
Uranyl complexes with the pyridine-2,6-dicarboxylato
ligand: new dinuclear species with \iupac{\bridge{}\haptonohyphen{2},\hapto{2}peroxide},
\iupac{\bridge{2}hydroxide} or \iupac{\bridge{2}methoxide bridges},
\bibliography{\jobname}
\end{document}