moved routines for latex environments, restructured table of contents