source: anuga_core/documentation/user_manual/update_anuga_user_manual.py @ 3575

Last change on this file since 3575 was 3575, checked in by ole, 18 years ago

Updated documentation compilation scripts

  • Property svn:executable set to *
File size: 1.2 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('~/inundation/anuga_core/documentation/user_manual')
28texfiles = ['anuga_user_manual', 'anuga_installation_guide']
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('makeindex mod%s.idx' %texfile)
41        os.system('bibtex %s' %texfile)   
42
43    # Create pdf file
44    os.system('dvips %s -o %s.ps' %((texfile,)*2))   
45    os.system('ps2pdf %s.ps' %texfile)   
46     
47    # Create html pages     
48    os.system('latex2html %s' %texfile)
49
Note: See TracBrowser for help on using the repository browser.