Archive for the 'LaTeX' Category

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

LaTeX packages in home directory

I finally figured out how to get downloaded LaTeX packages working from my home directory:

Create ~/texmf!

I’d actually known that first step since long ago, but it didn’t work after a few tries, so I gave up. Anyhow, it works now, and (for example) I can put a custom bst file in ~/texmf/bibtex/bst without needing separate copies of it in each directory where I have a document in need of it. yay!