11

In order to produce the following output involving a chemical formula

enter image description here

I can attempt to write the chemical formula as a mathematical formula:

\documentclass{report}
\usepackage{amsmath}
\begin{document}
    As the scintillator $\text{PbWO}_{\text{4}}$ crystals are used.
\end{document}

However, this method is a brute force when approaching a chemical formula. How would a versed Latex expert solve this task?

  • 2
    See the package mhchem for example, especially its \ce macro – user31729 Aug 3 '17 at 12:21
19

This might help you.

It boils down to using the package

\usepackage[version=4]{mhchem}

or

\usepackage{chemformula}

which then allows you to use, e.g.,

\ce{3H2O} \\
\ce{1/2H2O} \\
\ce{AgCl2-} \\
\ce{H2_{(aq)}}

or

\ch{3 H2O} \\
\ch{1/2 H2O} \\
\ch{AgCl2-} \\
\ch{H2_{(aq)}}

respectively.

|improve this answer|||||
  • Is there any diffence between mhchem and chemformula? Is there one that is considered more "standard" than the other by chemistry editors? – Oskar Limka Mar 11 at 19:29
  • 1
    I'm not aware of one being more standard. – gothicVI Mar 13 at 8:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.