v=`grep  v0 $1.out | sed 's/ # v0 =       //'`
graph.sh $1 $v 
gnuplot $1.plot.gnu
epstopdf  $1.graph.eps 
mv $1.graph.pdf fig.pdf  
tab.pl < $1.out.vout.tab > $1.tab.tex

echo "
\documentclass{article}
 \usepackage[pdftex]{graphics}
\begin{document}

` grep The $1.out | sed 's/#//'`
%The efficient ( \$X\$) for \$ v_0 = $v \$ is $x.
\begin{table}
\begin{center}
\caption{Data from a Type I sedimentation analysis.}
\input{$1.tab}
\end{center}
\label{tab}
\end{table}

\begin{figure}[!htp]
 \centering \scalebox{1.0}{\includegraphics{fig.pdf}}
  \caption{Cumulative settling velocity distribution curve calculated from the settling velocity
  data given in Table 1} \label{conv-ofn} \end{figure}
\end{document}
" > $1.report.tex

pdflatex $1.report.tex
pdflatex $1.report.tex
