CamteX
All guides

Chemical formulas in LaTeX

The mhchem package turns plain reaction notation into a properly typeset formula: digits after an element symbol become subscripts and charges become superscripts. No manual underscores needed.

Preamble

\usepackage[version=4]{mhchem}

Reaction equation

\ce{2H2 + O2 -> 2H2O}

Ions and equilibrium

\ce{CH3COOH <=> CH3COO- + H+}

Common mistakes

See also

Don't want to memorize commands?

Draw a formula or paste a screenshot, and CamteX turns it into ready LaTeX.

Try it free