Last change
on this file since 3108 was
3108,
checked in by ole, 18 years ago
|
Added scripts for automatically compiling planning and requirements documents
|
-
Property svn:executable set to
*
|
File size:
1.1 KB
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | """Update, compile and create PDF and HTML from LaTeX file |
---|
4 | |
---|
5 | This can for example be run from a cronjob: |
---|
6 | |
---|
7 | crontab -e |
---|
8 | |
---|
9 | with content |
---|
10 | |
---|
11 | SHELL=/bin/sh |
---|
12 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:~/bin |
---|
13 | |
---|
14 | # m h dom mon dow command |
---|
15 | 42 * * * * ~/anuga/documentation/user_manual/update_anuga_user_manual.py > ~/anuga/documentation/user_manual/update_anuga.log |
---|
16 | # |
---|
17 | |
---|
18 | |
---|
19 | Note UNIX only |
---|
20 | |
---|
21 | """ |
---|
22 | |
---|
23 | |
---|
24 | import os |
---|
25 | |
---|
26 | |
---|
27 | anugapath = os.path.expanduser('~/anuga/documentation/requirements') |
---|
28 | texfiles = ['anuga_API_requirements'] |
---|
29 | |
---|
30 | os.chdir(anugapath) # Move to location of LaTeX files |
---|
31 | os.system('svn up') # Update from svn |
---|
32 | |
---|
33 | |
---|
34 | for texfile in texfiles: |
---|
35 | print 'Processing %s' %texfile |
---|
36 | # Compile with LaTeX, makeindex etc |
---|
37 | for i in range(3): |
---|
38 | os.system('latex --interaction=nonstopmode %s.tex' %texfile) |
---|
39 | os.system('makeindex %s.idx' %texfile) |
---|
40 | os.system('bibtex %s' %texfile) |
---|
41 | |
---|
42 | # Create pdf file |
---|
43 | os.system('dvips %s -o %s.ps' %((texfile,)*2)) |
---|
44 | os.system('ps2pdf %s.ps' %texfile) |
---|
45 | |
---|
46 | # Create html pages |
---|
47 | os.system('latex2html %s' %texfile) |
---|
48 | |
---|
Note: See
TracBrowser
for help on using the repository browser.