#!/bin/sh
#############################################################################
##
#W  make_doc          make Example Package documentation          Greg Gamble
##
#H  $Id: make_doc,v 1.3 2003/10/23 13:34:34 gap Exp $
##
##  This shell script uses TeX, BibTeX and MakeIndex to build the .dvi, Adobe
##  PDF, PostScript (commented out) and  HTML  (provided  you  have  tth  and
##  etc/convert.pl) documentation for the Example Package.
##

#
# Set default paths for convert.pl and manualindex, if they are not set already. 
#
if [ "$CONVERT"X == "X" ]; then
    CONVERT=../../../etc/convert.pl 
fi

if [ "$MANUALINDEX"X == "X" ]; then
    MANUALINDEX=../../../doc/manualindex
fi


echo "TeXing documentation"
# TeX the manual
tex manual
# ... and build its bibliography (uncomment if there is a `manual.bib')
bibtex manual
# TeX the manual again to incorporate the ToC ... and build the index
tex manual; $MANUALINDEX manual
# Finally TeX the manual again to get cross-references right
tex manual
# Create the PostScript version (uncomment next line, if needed)
dvips -D300 manual -o
# Create PDF version
pdftex manual; pdftex manual

# The HTML version of the manual
mkdir -p ../htm
echo "Creating HTML documentation"
$CONVERT -t -c -n ALNUTH . ../htm

#############################################################################
##
#E
