# Implements -ps2pdf
# We asume that it was lauched with -advi 

mycopy () {
    FROM=$(basename $1 .dvi)
    (cd $WOUT && \
    $DVIPS -o "$FROM.ps" "$FROM.dvi" 2>/dev/null && \
    rm "$FROM.dvi" && \
    ps2pdf -dALLOWPSTRANSPARANCY "$FROM.ps" "$FROM.pdf" && \
    # Change of target should be atomic. 
    mv "$FROM.pdf" "$2")
}

set -x

WHIZZYTMPFILES="{$NAME.dvi.ps,$WHIZZY.dvi.ps}"

SIGDVI=$SIGPDF
DVICOPY=mycopy
LEVEL=1
RELOAD=xpdfreload
VIEWCOMMAND="xpdf -remote $$"
