Thesis code and sweave