#!/bin/sh
set -e

echo "TeXing documentation"
# TeX the manual
tex manual
# ... and build its bibliography (uncomment if there is a `manual.bib')
bibtex manual
# HACK
mv manual.bbl manual.bbl.mod
sed -e 's/{\\textendash}/--/' -e "s/{\\\a'A}/A/" < manual.bbl.mod > manual.bbl
rm -f manual.bbl.mod

# TeX the manual again to incorporate the ToC ... and build the index
tex manual; ../../../doc/manualindex manual
# Finally TeX the manual again to get cross-references right
tex manual

# Generate pdf version
pdftex manual
pdftex manual

# The HTML version of the manual
mkdir -p ../htm
echo "Creating HTML documentation"
../../../etc/convert.pl -i -u -c -n ITC . ../htm

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