1998-05-07 01:38:16 +00:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
1999-02-15 19:27:07 +00:00
|
|
|
# Build one of the simple documents. This can be used to create the DVI,
|
|
|
|
# PDF, or LaTeX "aux" files. It can accept one of three optional parameters:
|
|
|
|
#
|
|
|
|
# --aux Create only the LaTeX .aux file
|
|
|
|
# --dvi Create the DeVice Independent output
|
|
|
|
# --pdf Create Adobe PDF output
|
|
|
|
#
|
|
|
|
# If no parameter is given, DVI output is produced.
|
|
|
|
#
|
|
|
|
# One positional parameter is required: the "base" of the document to
|
|
|
|
# format. For the standard Python documentation, this will be api, ext,
|
|
|
|
# lib, mac, ref, or tut.
|
1998-05-07 01:38:16 +00:00
|
|
|
|
|
|
|
WORKDIR=`pwd`
|
|
|
|
cd `dirname $0`/..
|
|
|
|
srcdir=`pwd`
|
|
|
|
cd $WORKDIR
|
|
|
|
|
1998-05-07 17:28:42 +00:00
|
|
|
latex=latex
|
1999-02-15 19:27:07 +00:00
|
|
|
aux=''
|
|
|
|
pdf=''
|
1998-05-07 17:28:42 +00:00
|
|
|
if [ "$1" = "--pdf" ] ; then
|
|
|
|
pdf=true
|
|
|
|
latex=pdflatex
|
|
|
|
shift 1
|
1999-02-15 19:27:07 +00:00
|
|
|
elif [ "$1" = "--aux" ] ; then
|
|
|
|
aux=true
|
|
|
|
shift 1
|
|
|
|
elif [ "$1" = "--dvi" ] ; then
|
|
|
|
shift 1
|
1998-05-07 17:28:42 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
part=$1; shift 1
|
1998-05-07 01:38:16 +00:00
|
|
|
|
2000-04-03 04:19:14 +00:00
|
|
|
TEXINPUTS=.:$srcdir/$part:$TEXINPUTS
|
1998-05-07 01:38:16 +00:00
|
|
|
export TEXINPUTS
|
|
|
|
|
1998-05-11 19:06:26 +00:00
|
|
|
echo $srcdir'/tools/newind.py >'$part'.ind'
|
1998-05-07 17:28:42 +00:00
|
|
|
$srcdir/tools/newind.py >$part.ind || exit $?
|
1999-04-14 05:02:06 +00:00
|
|
|
echo $srcdir'/tools/newind.py modindex >mod'$part'.ind'
|
|
|
|
$srcdir/tools/newind.py modindex >mod$part.ind || exit $?
|
1998-05-11 19:06:26 +00:00
|
|
|
echo "$latex $part"
|
1998-05-07 17:28:42 +00:00
|
|
|
$latex $part || exit $?
|
1999-04-14 05:02:06 +00:00
|
|
|
if [ ! -f mod$part.idx ] ; then
|
|
|
|
echo "Not using module index; removing mod$part.ind"
|
1999-04-14 13:13:32 +00:00
|
|
|
rm mod$part.ind || exit $?
|
1999-04-14 05:02:06 +00:00
|
|
|
fi
|
1999-02-15 19:27:07 +00:00
|
|
|
if [ "$aux" ] ; then
|
|
|
|
# make sure the .dvi isn't interpreted as useful:
|
1999-04-14 13:13:32 +00:00
|
|
|
rm $part.dvi || exit $?
|
1998-05-07 01:38:16 +00:00
|
|
|
else
|
1999-02-15 19:27:07 +00:00
|
|
|
if [ -f $part.idx ] ; then
|
|
|
|
# using the index
|
|
|
|
echo $srcdir'/tools/fix_hack '$part'.idx'
|
|
|
|
$srcdir/tools/fix_hack $part.idx || exit $?
|
|
|
|
echo 'makeindex -s '$srcdir'/texinputs/python.ist '$part'.idx'
|
|
|
|
makeindex -s $srcdir/texinputs/python.ist $part.idx || exit $?
|
1999-04-14 13:13:32 +00:00
|
|
|
echo $srcdir'/tools/indfix.py '$part'.ind'
|
|
|
|
$srcdir/tools/indfix.py $part.ind || exit $?
|
1999-02-15 19:27:07 +00:00
|
|
|
else
|
|
|
|
# skipping the index; clean up the unused file
|
|
|
|
rm -f $part.ind
|
|
|
|
fi
|
1999-04-14 05:02:06 +00:00
|
|
|
if [ -f mod$part.idx ] ; then
|
|
|
|
# using the index
|
|
|
|
echo 'makeindex -s '$srcdir'/texinputs/python.ist mod'$part'.idx'
|
|
|
|
makeindex -s $srcdir/texinputs/python.ist mod$part.idx || exit $?
|
|
|
|
fi
|
1999-02-15 19:27:07 +00:00
|
|
|
if [ "$pdf" ] ; then
|
|
|
|
echo $srcdir'/tools/toc2bkm.py '$part
|
1999-04-14 13:13:32 +00:00
|
|
|
$srcdir/tools/toc2bkm.py $part || exit $?
|
1999-02-15 19:27:07 +00:00
|
|
|
fi
|
|
|
|
echo "$latex $part"
|
|
|
|
$latex $part || exit $?
|
1998-05-07 01:38:16 +00:00
|
|
|
fi
|