Work in progress on fixing latex build

Changes required to get it building locally and tweaks to try to get it building on travis.