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:

    As the scintillator $\text{PbWO}_{\text{4}}$ crystals are used.

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

This might help you.

It boils down to using the package




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

\ce{3H2O} \\
\ce{1/2H2O} \\
\ce{AgCl2-} \\


\ch{3 H2O} \\
\ch{1/2 H2O} \\
\ch{AgCl2-} \\


|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.