August 1, 2026

Typing chemistry by hand in LaTeX is miserable — H_2SO_4 italicises the elements, charges collide with subscripts, and arrows never sit right. The mhchem package fixes all of it with one command. This guide covers formulae, charges, reaction arrows, states of matter, isotopes and the chemistry-heavy tables that show up in real papers.
Written as $H_2SO_4$, LaTeX treats every letter as a variable and sets it in italic. Element symbols are upright by convention, so that is typographically incorrect before you even get to spacing. mhchem handles the conventions for you:
Everything then goes inside \ce{...}, and subscripts need no underscores at all — digits after an element are recognised automatically:
Compiled output

Write the charge exactly as you would say it. mhchem raises it and keeps it clear of the subscripts:
Compiled output

Order matters: \ce{SO4^2-} is the sulfate ion, while \ce{SO4^-2} is not valid charge notation. Write the magnitude, then the sign.
Arrows are typed as ASCII art and rendered properly. The common ones:
-> forward reaction<-> resonance<=> equilibrium<=>> and <<=> equilibrium favouring one sideCompiled output

Conditions go above and below the arrow in square brackets and parentheses respectively:
Compiled output

Compiled output

v marks a precipitate and ^ a gas evolving. Isotope mass and atomic numbers go in braces before the symbol.
Formulae are the easy part. What actually costs an afternoon is a journal table — merged row headers, superscript footnote markers, subscripted formulae in every cell and a block of footnotes underneath.
Two things make these tables hard by hand. Row headers spanning several rows need multirow, and footnote markers inside a tabular do not work with plain \footnote — you need \textsuperscript markers with the notes written out below, or the threeparttable package.
Pair mhchem with siunitx so quantities are consistent too. Write \SI{450}{\celsius} rather than typing the degree symbol, and the spacing between number and unit is handled for you. Units siunitx does not know — such as kcal — need declaring once with \DeclareSIUnit:
Compiled output

\usepackage[version=4]{mhchem} once in the preamble\ce{...} — no underscores needed for subscripts^2-, magnitude before sign->, <=> for arrows; conditions in [ ] above and [ ] belowmultirow plus \textsuperscript markers for journal tablesSee also our guides on subscripts and superscripts and building LaTeX tables.
Try it free
Reaction schemes, data tables and supporting information, converted from the page instead of retyped. Every value stays where it was.
Convert your page
Empowering students and researchers with AI-powered tools for academic writing.
Go to appContact us© 2026 Underleaf. All rights reserved.