mkdvi.sh 906 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
#! /bin/sh
#
#  Build one of the simple documents.

WORKDIR=`pwd`
cd `dirname $0`/..
srcdir=`pwd`
cd $WORKDIR

10 11 12 13 14 15 16 17
latex=latex
if [ "$1" = "--pdf" ] ; then
    pdf=true
    latex=pdflatex
    shift 1
fi

part=$1; shift 1
18

19
TEXINPUTS=$srcdir/$part:$TEXINPUTS
20 21
export TEXINPUTS

22
echo $srcdir'/tools/newind.py >'$part'.ind'
23
$srcdir/tools/newind.py >$part.ind || exit $?
24
echo "$latex $part"
25 26
$latex $part || exit $?
if [ -f $part.idx ] ; then
27
    # using the index
28
    echo $srcdir'/tools/fix_hack '$part'.idx'
29
    $srcdir/tools/fix_hack $part.idx || exit $?
30 31
    echo 'makeindex -s '$srcdir'/texinputs/python.ist '$part'.idx'
    makeindex -s $srcdir/texinputs/python.ist $part.idx || exit $?
32 33
else
    # skipping the index; clean up the unused file
34 35 36
    rm -f $part.ind
fi
if [ "$pdf" ] ; then
37
    echo $srcdir'/tools/toc2bkm.py '$part
38
    $srcdir/tools/toc2bkm.py $part
39
fi
40
echo "$latex $part"
41
$latex $part || exit $?