#!/bin/csh
#
# File:   qasm2pdf
# Date:   23-Mar-04
# Author: I. Chuang <ichuang@mit.edu>
#
# Shell script to convert qasm files to pdf, using the qasm2tex python script
#
# Usage:  qasm2pdf foo.qasm
#
# Produces: foo.pdf  (and also foo.tex, foo.epsf)

foreach i ($*)

        set t = `echo $i | sed "s/.qasm//"`

	python qasm2tex.py $i >! $t.tex
	if (-z $t.tex) then
	    echo "error in qasm2tex on $t.tex! aborting."
	else
	    latex $t
	    dvips -D2400 -E -o $t.eps $t
	    epstopdf $t.eps
	endif
end
