#!/bin/sh

ROOT=..

rm *.toc

sage -b
./update
makeindex ref
touch modref.ind
export TEXINPUTS=$ROOT/ref:$ROOT/commontex:$ROOT/paper-letter:$ROOT/texinputs:
#LATEXARGS="-file-line-error-style -interaction=nonstopmode"
LATEXARGS="-file-line-error-style"

if latex $LATEXARGS ref                   # &> /dev/null  # Suppress output.
then
  echo "DVI Documentation built."
else
  echo "Problems building DVI documentation."
  ./texfilter.py < ref.log
fi
