Typesetting Chemistry with mhchem
AS
Aman Saurav
5 min read
#chemistry
#equations
The mhchem package is the standard for typesetting chemical formulae and reactions in LaTeX. It provides the powerful \ce command.
Installation
In your preamble, include:
\usepackage[version=4]{mhchem}
Basic Formulas
You can write simple formulas intuitively:
- Water:
\ce{H2O} - Sulfuric Acid:
\ce{H2SO4} - Ions:
\ce{Ag+}
Chemical Reactions
You can create complex arrow reactions easily.
- Precipitate Reaction:
\ce{Ag+ + Cl- -> AgCl v}
Example Output
Here is what the rendered output looks like in a document:

Video Tutorial
For a deep dive, check out this tutorial: Mastering mhchem in 10 Minutes
The space inside the
\ce{}command is significant. Use it to separate species.