I discovered a problem when using BibLaTeX' cite-style apa together with mhchem when the bib-file contains chemical formulas with subscripts/superscripts. The MWE is
\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 contains only a simple chemical formula and works perfectly fine:
@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},
}
Cite 2 contains superscript, and leads to 14 errors:
@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},
}
The problem seems to be, that BibLaTeX switches into Mathmode, although \ce should prevent that:
A simple \protect, as in {\protect\ce{\delta^{18}O}}, solves that problem, but creates another, because now the "O" is made lowercase.
I would need the rather convoluted version {\protect\ce{\delta^{18}\MakeUppercase{O}}} to finally get the correct result:
Since the real bib-file contains many entries, I would understandably not like to manually change them all. Curiously, it works perfectly fine with the authoryear-style, the problem is apparently apa-specific. I would be very thankful for any suggestions how to tackle this issue.



