Add amsmath support

This fixes #223.
Merge pull request #229 from stianjensen/amsmath

Add amsmath support