Posts Tagged 'chemistry'

Chemistry and LaTeX with mhchem

There is a LaTeX package called mhchem available that makes typesetting chemical equations a lot easier. Sure, you could be lazy and type it all out in math mode like this (sorry, I don’t know much chemistry yet):

[text{C}_6text{H}_{12}text{O}_6 + 6text{O}_2 xrightarrow{text{heat}} 6text{CO}_2 + 6text{H}_2text{O}]

or in text mode:

C$_6$H$_{12}$O$_6$ + 6O$_2 xrightarrow{text{heat}}$ 6CO$_2$ + 6H$_2$O

But that’s ridiculous. Writing it is a pain, and fonts become inconsistent (math vs. normal text). With the mhchem package, however, I can do this:

[ce{C6H12O6 + 6O2 ->[text{heat}] 6CO2 + 6H2O}]

Thank you Martin Hensel, who developed this!