Can now be run from the command line. The insertion of the title page and toc is all fucked up.