source: documentation/requirements/update_anuga_requirements.py @ 3108

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
5This can for example be run from a cronjob:
6
7  crontab -e
8
9with content
10
11SHELL=/bin/sh
12PATH=/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
19Note UNIX only
20 
21"""
22
23
24import os
25
26
27anugapath = os.path.expanduser('~/anuga/documentation/requirements')
28texfiles = ['anuga_API_requirements']
29
30os.chdir(anugapath) # Move to location of LaTeX files
31os.system('svn up') # Update from svn
32
33
34for 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.