This is a request of clarification for a quirk I've found with the accepted solution of Typesetting chemical element names
If I attempt to use such solution, and I define a couple of new macros as
\newcommand{\chem}[1]{\ensuremath{\mathrm{#1}}}
\newcommand{\AlO}{\chem{Al_{2}O_{3}}}
using the latter in the bibliography (managed through Biblatex + Biber backend) gives me lots of errors of the kind:
! Missing } inserted.
<inserted text>
}
l.835
?
! Extra }, or forgotten \endgroup.
\MakeLowercase ... {\lowercase {#1}}\reserved@a }
l.835
?
! LaTeX Error: \mathrm allowed only in math mode.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.835
?
! Missing $ inserted.
<inserted text>
$
l.835
In the rest of the text things seem working fine. I'm relatively new to Latex, is there something I'm doing wrong?

.bibentries that reproduces the issue. See https://tex.meta.stackexchange.com/q/228/35864 and https://tex.meta.stackexchange.com/q/4407/35864. I'm guessing it could have something to do with a style that applies sentence case, in which case curly braces around your macros might help, i.e.title = {Foo {\AlO} bar},, but I might be horribly wrong. – moewe Oct 24 '18 at 09:29