#!/bin/csh -f
# Change text file to .dvi using LaTeX verbatim environment in a 10pt document
# Very long lines may be truncated.

set fileroot = $1:r
if (-e $fileroot.tex) then
   echo "Overwrite $fileroot.tex? [n/y]"
   set answer = $<
   if ("$answer" == "n") exit 2
endif

echo "\documentstyle[inchmargs,headsup,feetdown]{article}\
\nofiles\
\setlength{\parskip}{\medskipamount}\
\pagestyle{empty}\
\begin{document}\
\begin{verbatim}" > $fileroot.tex

cat $1 >> $fileroot.tex

echo "\end{verbatim}\
\end{document}" >> $fileroot.tex

latex $fileroot

rm $fileroot.tex
