#!/usr/bin/env python """Update, compile and create PDF and HTML from LaTeX file This can for example be run from a cronjob: crontab -e with content SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:~/bin # m h dom mon dow command 42 * * * * ~/anuga/documentation/user_manual/update_anuga_user_manual.py > ~/anuga/documentation/user_manual/update_anuga.log # Note UNIX only """ import os anugapath = os.path.expanduser('~/anuga/documentation/planning') texfiles = ['priorities'] os.chdir(anugapath) # Move to location of LaTeX files os.system('svn up') # Update from svn for texfile in texfiles: print 'Processing %s' %texfile # Compile with LaTeX, makeindex etc for i in range(3): os.system('latex --interaction=nonstopmode %s.tex' %texfile) os.system('makeindex %s.idx' %texfile) os.system('bibtex %s' %texfile) # Create pdf file os.system('dvips %s -o %s.ps' %((texfile,)*2)) os.system('ps2pdf %s.ps' %texfile) # Create html pages os.system('latex2html %s' %texfile)