Biblatex-apa 与 mhchem 的问题

Biblatex-apa 与 mhchem 的问题

BibLaTeX我发现在使用'cite-style时apa,如果mhchembib-file 包含带下标/上标的化学式,就会出现问题。MWE 是

\documentclass{article}
\usepackage[version=4]{mhchem}
\usepackage[style=apa, backend=biber]{biblatex}
%\usepackage[style=authoryear, backend=biber]{biblatex}
\addbibresource{Bib.bib}

\begin{document}

This is a citation with only simple chemistry: \parencite{Cite1}.

This is a citation with superscript: \parencite{Cite2}.

\printbibliography
\end{document}

Cite1 仅包含一个简单的化学公式,但运行良好:

@Article{Cite1,
  author       = {Author, A.},
  date         = {2020},
  journaltitle = {A Journal},
  title        = {A title with just some \ce{Mg/Ca} chemistry},
  issue        = {2},
  pages        = {1--4},
  volume       = {1},
  timestamp    = {2020-03-27},
}

引用 2 包含上标,导致 14 个错误:

@Article{Cite2,
  author       = {Author, B.},
  date         = {2020},
  journaltitle = {Another Journal},
  title        = {A title with some more complicated \ce{\delta^{18}O} chemistry and a longer title},
  issue        = {1},
  pages        = {2--6},
  volume       = {8},
  timestamp    = {2020-03-27},
}

问题似乎是,BibLaTeX切换到数学模式,虽然\ce应该可以防止这种情况发生:

在此处输入图片描述

简单的\protect,如{\protect\ce{\delta^{18}O}},解决了该问题,但却产生了另一个问题,因为现在“O”变成了小写。

在此处输入图片描述

我需要相当复杂的版本{\protect\ce{\delta^{18}\MakeUppercase{O}}}才能最终得到正确的结果:

在此处输入图片描述

由于实际的 bib 文件包含许多条目,因此我当然不想手动更改所有条目。奇怪的是,它与 -style 配合得很好authoryear,问题显然是apa- 特有的。我将非常感谢任何有关如何解决此问题的建议。

答案1

biblatex-apa使用 来应用句子大小写\MakeSentenceCase*。该宏相当复杂,基本上只能处理纯文本而不会中断。

如果标题中包含复杂的宏,则需要用一对括号来隐藏/保护它们。

支架保护的复杂规则意味着你需要如果括号内的内容以宏开头,并且您想要保留大写,则需要使用大写字母对。

\documentclass{article}
\usepackage[version=4]{mhchem}
\usepackage[style=apa, backend=biber]{biblatex}


\begin{filecontents}{\jobname.bib}
@Article{Cite1,
  author       = {Author, A.},
  date         = {2020},
  journaltitle = {A Journal},
  title        = {A Title with Just Some {{\ce{Mg/Ca}}} Chemistry},
  issue        = {2},
  pages        = {1--4},
  volume       = {1},
}
@Article{Cite2,
  author       = {Author, B.},
  date         = {2020},
  journaltitle = {Another Journal},
  title        = {A Title with Some More Complicated {{\ce{\delta^{18}O}}}
                  Chemistry and a Longer Title},
  issue        = {1},
  pages        = {2--6},
  volume       = {8},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
This is a citation with only simple chemistry: \parencite{Cite1}.

This is a citation with superscript: \parencite{Cite2}.

\printbibliography
\end{document}

作者 A. (2020)。标题中只包含一些 Mg/Ca 化学反应。A Journal,1,1-4。//作者 B. (2020)。标题中有一些更复杂的 δ 18 O 化学反应和更长的标题。Another Journal,8,2-6。

相关内容