Moved latex and slime stuff into separate files to improve portability