chmod +x termproject
./termproject  $1
cat $1.out*
v=`grep  v0 $1.out | sed 's/ # v0 =       //'`
chmod +x tab.pl graph.sh
sh graph.sh $1 $v 
gnuplot $1.plot.gnu
epstopdf  $1.graph.eps 
#convert $1.graph.eps  $1.graph.jpg
mv $1.graph.pdf fig.pdf  
./tab.pl < $1.out.vout.tab > $1.tab.tex

echo "
\documentclass{article}
\textheight=10.00in
\textwidth=7.50in
\oddsidemargin=-0.40in
\footskip=0.30in
\setlength{\headheight}    {0.00in}
 \setlength{\headsep}       {0.00in} 
  \setlength{\textheight}    {9.00in}
   \setlength{\footskip}      {0.50in}
    \setlength{\oddsidemargin} {0.00in}
     \setlength{\textwidth}     {6.50in}
      \setlength{\marginparsep}  {0.00in}

 \usepackage[pdftex]{graphics}
\begin{document}
\title{Output file of Settling analsis of type--1 sedimentation for input file : \tt{$1} }
\author{Saurabh Arun Samdani, Saurabh Kapoor \\\\
	        B.Tech Fourth year,\\\\ Department of Civil Engineering,\\\\
	        Indian Institute of Technology Guwahati \\\\
	}

	        %\thanks{Undergraduate Student, Department of Civil Engineering ,
	        %Indian Institute of Technology Guwahati} 
\date{}
\maketitle

%Name of input file: $1. \newline
` grep The $1.out | sed 's/#//'`
\begin{table}
\begin{center}
\caption{Data from a Type I sedimentation analysis as per \tt{$1}.}
\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
#rm fig.pdf

