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!

  1. Maaaan, you know there is such thing in the web like search engine, if you don’t, go there to understand why this post is bullshit

    • Googling terms like “chemistry,” “simple,” “latex,” and “typesetting” doesn’t return many results with “mhchem” in it (i.e., it took me more than a few cumulative hours of searching), which is why I posted this here.

      Perhaps you could instead point me to a page that explains how to write a not-so-bs blog post?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: