Yesterday I gave the following tip on TeXtip:
Set chemical formulas with math Roman. Example: sulfate is
$mathrm{SO_4^{2-}}$
TorbjoernT and scmbradley let me know there’s a better way: use Martin Hansel’s package mhchem
. The package is simpler to use and it correctly handles subtle typographical details.
Using the mhchem
package, sulfate would be written ce{SO4^2-}
. In addition to chemical compounds, mhchem
has support for bonds, arrows, and related chemical notation.
Example:
Source:
\documentclass{article} \usepackage[version=3]{mhchem} \parskip=0.1in \begin{document} \ce{SO4^2-} \ce{^{227}_{90}Th+} \ce{A\bond{-}B\bond{=}C\bond{#}D} \ce{CO2 + C -> 2CO} \ce{SO4^2- + Ba^2+ -> BaSO4 v} \end{document}
For more information, see the mhchem package documentation.
Thanks for your notes. Very useful and work perfectly with MacTeX out of the box.
Thanks, John, for posting this! I was having trouble finding any documentation on the mhchem package. Now my nuclear reaction notation looks just right.
mhchem is very useful, but one thing it won’t do is properly typeset IUPAC names like 3-ethyl-2,2,5-trimethylhexane. For IUPAC names, use bpchem along with mhchem.
Hi,
I have to write represent a ring C10 to C15 in LaTeX.
How to write. Chemfig (\ce) subscripts the number.
Please help.