The 0.5 release happened on 2/15, not on 2/14. :-)
[python/dscho.git] / Doc / tools / mkdvi.sh
blob3269a287ee070ec01d3c67cac4604b7856c82acb
1 #! /bin/sh
3 # Build one of the simple documents. This can be used to create the DVI,
4 # PDF, or LaTeX "aux" files. It can accept one of three optional parameters:
6 # --aux Create only the LaTeX .aux file
7 # --dvi Create the DeVice Independent output
8 # --pdf Create Adobe PDF output
10 # If no parameter is given, DVI output is produced.
12 # One positional parameter is required: the "base" of the document to
13 # format. For the standard Python documentation, this will be api, ext,
14 # lib, mac, ref, or tut.
16 WORKDIR=`pwd`
17 cd `dirname $0`/..
18 srcdir=`pwd`
19 cd $WORKDIR
21 latex=latex
22 aux=''
23 pdf=''
24 if [ "$1" = "--pdf" ] ; then
25 pdf=true
26 latex=pdflatex
27 shift 1
28 elif [ "$1" = "--aux" ] ; then
29 aux=true
30 shift 1
31 elif [ "$1" = "--dvi" ] ; then
32 shift 1
35 part=$1; shift 1
37 TEXINPUTS=$srcdir/$part:$TEXINPUTS
38 export TEXINPUTS
40 echo $srcdir'/tools/newind.py >'$part'.ind'
41 $srcdir/tools/newind.py >$part.ind || exit $?
42 echo $srcdir'/tools/newind.py modindex >mod'$part'.ind'
43 $srcdir/tools/newind.py modindex >mod$part.ind || exit $?
44 echo "$latex $part"
45 $latex $part || exit $?
46 if [ ! -f mod$part.idx ] ; then
47 echo "Not using module index; removing mod$part.ind"
48 rm mod$part.ind || exit $?
50 if [ "$aux" ] ; then
51 # make sure the .dvi isn't interpreted as useful:
52 rm $part.dvi || exit $?
53 else
54 if [ -f $part.idx ] ; then
55 # using the index
56 echo $srcdir'/tools/fix_hack '$part'.idx'
57 $srcdir/tools/fix_hack $part.idx || exit $?
58 echo 'makeindex -s '$srcdir'/texinputs/python.ist '$part'.idx'
59 makeindex -s $srcdir/texinputs/python.ist $part.idx || exit $?
60 echo $srcdir'/tools/indfix.py '$part'.ind'
61 $srcdir/tools/indfix.py $part.ind || exit $?
62 else
63 # skipping the index; clean up the unused file
64 rm -f $part.ind
66 if [ -f mod$part.idx ] ; then
67 # using the index
68 echo 'makeindex -s '$srcdir'/texinputs/python.ist mod'$part'.idx'
69 makeindex -s $srcdir/texinputs/python.ist mod$part.idx || exit $?
71 if [ "$pdf" ] ; then
72 echo $srcdir'/tools/toc2bkm.py '$part
73 $srcdir/tools/toc2bkm.py $part || exit $?
75 echo "$latex $part"
76 $latex $part || exit $?