#!/bin/bash if [ -z "$1" ]; then echo echo "Script calls Lout the required number of times in order to correctly" echo "resolve cross-references for the specified Lout document. You must" echo "run this script from the same directory as the given document!" echo echo "Usage: $0 []" echo echo "If is not specified it defaults to ." echo "This version generates both PS and PDF files named .ps/.pdf." echo "Because PDF output from Lout is incomplete, we use xloutps and then" echo "ghostscript to correctly transform the PostScript file to PDF!" echo exit fi COUNTER=1 OUTFILE=$2 if [ -z "$2" ]; then OUTFILE="$1" fi OUTPDF="$OUTFILE.pdf" ./xloutps "$1" "$OUTFILE" echo "Converting $OUTFILE.ps to $OUTPDF:" gs -sDEVICE=pdfwrite -sOutputFile="$OUTPDF" -dNOPAUSE -dBATCH "$OUTFILE.ps" echo "Done."