I have looked through the Geochemistry book. See below for representative markup.
I include examples of SI units, because the book uses them, and also I see that as
basically the same issue.
I also looked at the mhchem package, to see if it could handle everything in that
particular book. The answer is no: mhchem does not have built-in support for
isotopes and it does not seem to handle bonds in the same way. The syntax for
multiline chemistry displays is superficially different.
Does the following seem feasible (assuming someone is willing to do it), and are
there any competing options?
Introduce PreTeXt markup for inline and display chemistry, analogous to "m" and
"md" for math. In the preprocessing step, extract all the chemistry and convert it
to TeX math markup. Then process as usual.
Regards,
David
Below is a pretty good representation of the chemistry markup in one book.
Inline:
\ch{H+}
\pH\
\pOH\
\SI{25}{\celsius}
\num{1.0e-7}
\SI{3.47e-3}{\moLar}
\ch{H2CO3^* \aq}
\SI{1.0}{M}
\SI{e-5}{\mole}
\SI{0.0821}{\atmosphere\liter\per\mole\kelvin}
\enthalpy(rxn){-41}
\isotope*{14,C}
\isotope{3,H}
\ch{C_n H_{2n+2}}
\si{\micro\gram\per\liter}
\SIrange{e-4}{e-8}{\atmosphere}
Display:
\begin{reaction*}
HX -> H+ + X-
\end{reaction*}
\begin{reaction*}
CaSO4.2 H2O \sld ->[\water] Ca^2+ \aq{} + SO4^2- \aq{} + 2 H2O\lqd
\end{reaction*}
\begin{reaction*}
\isotope{137,Cs} -> \isotope{137,Ba}\, (excited state) -> \isotope{137,Ba} + $\gamma$
\end{reaction*}
\begin{reactions*}
CO2 \gas{} <=>[\water\lqd] CO2 \aq\\
CO2 \aq{} + H2O \lqd <=> H2CO3 \aq \\
H2CO3\aq{} <=> H+ \aq{} + HCO3- \aq \\
HCO3- \aq <=> H+ \aq{} + CO3^2- \aq
\end{reactions*}
\begin{reactions*}
2 SO2 \gas{} + O2 \gas{} &-> 2 SO3 \gas{}&\\
SO3 \gas{} + H2O \lqd{} &-> H2SO4 \aq{}&\\
H2SO4 \aq{} &-> H+ \aq{} + HSO4^- \aq{}&
\end{reactions*}
\begin{reactions*}
2 Na + Cl2 &-> 2 Na+ + 2 Cl-\\
2 "\ox*{0,Na}" + "\ox*{0,Cl2}" &-> 2 "\ox*{+1,Na+}" + 2 "\ox*{-1,Cl-}"
\end{reactions*}
\begin{reactions*}
O + 2 \el &-> O^2- \\
N + 3 \el &-> N^3-
\end{reactions*}
\begin{reactions*}
"\chlewis{0.}{H}" + "\chlewis{180.}{H}" &-> H\bond{sb}H -> H2\\
"\chlewis{0.90,180.270,}{O}" + "\chlewis{0.90,180.270,}{O}" &-> "\chlewis{90,270,}{O}" \bond{db} "\chlewis{90,270,}{O}" -> O2\\
"\chlewis{0.90.180,270.}{N}" + "\chlewis{0,90.180.270.}{N}" &-> "\chlewis{180,}{N}" \bond{tp} "\chlewis{0,}{N}" -> N2
\end{reactions*}