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!

Advertisements

4 Responses to “Chemistry and LaTeX with mhchem”


  1. 1 Liniuphep February 22, 2009 at 04:59

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

    • 2 undefined117 February 23, 2009 at 01:22

      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?

  2. 3 Jorgen May 31, 2010 at 07:45

    Thanks for posting this! As you say, it’s not so easy to find info about mhchem. Don’t mind the trolls.

  3. 4 5 mistakes December 9, 2011 at 08:21

    Your blog is pretty interesting to me and your subject matter is very relevant. I was browsing around and came across something you might find interesting. I was guilty of 3 of them with my sites. “99% of website owners are guilty of these 5 errors”. http://bit.ly/ts0ScL You will be suprised how simple they are to fix.


Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: