#MAKE-HPF-JOD
#!/bin/csh

#Version of March 23, 1993 - David Loveman, Digital Equipment Corporation

#set TEXroot=/usr/local/bin
#alias latex $TEXroot/latex
#alias dvips $TEXroot/dvips
#alias xdvi $TEXroot/xdvi

set thedate = `date`
echo "  "
echo BEGIN JOB ON: $thedate

echo "this script assumes that latex, dvips, and xdvi"
echo "are on your search path"

echo "  "
which latex

##################################################
#        Run LATEX the first time
##################################################
echo "  "
echo "latex hpf-jod the first time"
latex hpf-jod < /dev/null
if($status != 0) then
   echo "first LATEX run fails, quit"
   exit(1)
endif

##################################################
#        Run LATEX the second time
##################################################
echo "  "
echo "latex hpf-jod the second time"
latex hpf-jod < /dev/null
if($status != 0) then
   echo "second LATEX run fails, quit"
   exit(1)
endif

##################################################
#        Run LATEX the third time
##################################################
echo "  "
echo "latex hpf-jod the third time"
latex hpf-jod < /dev/null
if($status != 0) then
   echo "third LATEX run fails, quit"
   exit(1)
endif

##################################################
#        Run dvips to produce a ps file
##################################################
echo "  "
echo "dvips hpf-jod -o hpf-jod.ps"
dvips hpf-jod -o hpf-jod.ps
if($status != 0) then
   echo "DVIPS fails, quit"
   exit(1)
endif

##################################################
#        Run xdvi to view the ps file
##################################################
echo "  "
echo "xdvi hpf-jod"
xdvi hpf-jod &

##################################################
#        Print the ps file
##################################################
echo "  "
echo "now print the postscript file (this script doesn't)"
echo "the HPF JoD is meant to be two-sided"
echo "the following command works on a Digital PrintServer"
echo "lpr -Oportrait -Dpostscript -K2 hpf-jod.ps"
echo "you may not need the -Oportrait -Dpostscript -K2 options"
#lpr -Oportrait -Dpostscript -K2 hpf-jod.ps

echo "  "
echo "done"
echo "  "

