Index: mttroot/mtt/bin/trans/struc_txt2tex ================================================================== --- mttroot/mtt/bin/trans/struc_txt2tex +++ mttroot/mtt/bin/trans/struc_txt2tex @@ -13,10 +13,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +# Revision 1.1 1997/04/15 09:49:04 peterg +# Initial revision +# ############################################################### # Inform user echo "Creating $1_struc.tex" @@ -26,35 +29,45 @@ #Write some file headers echo "%% Structure file ($1_struc.txt)" > $1_struc.tex echo "%% Generated by MTT at `date`" >> $1_struc.tex # This is the main transformation using gawk -gawk ' -function header(){ - print "\\begin{tabular}{l|l|l}"; +sed 's/_/\\_/g' < $1_struc.txt | gawk ' +function header(what){ +# print "\\begin{table}[htbp]"; + print " \\centering"; + print " \\bottomcaption{" what "}"; + print " \\begin{supertabular}{|l|l|l|l|}"; + print " \\hline"; + print " Index & Component & System & Repetition \\\\"; + print " \\hline"; } function footer(what){ - print "\\caption{" what "}"; - print "\\end{tabular}" + print " \\hline"; + print " \\end{supertabular}"; +# print " \\caption{" what "}"; +# print "\\end{table}"; + print " \\bigskip"; + print " \\bigskip"; } BEGIN{ Which="" } { if ($1!=Which) { if (Which!="") footer(Which); - header(); + header($1); } - print $2, $3, $4; + print $2, "&", $3,"&", $4, "&", $5, "\\\\"; Which = $1; } END{ footer(Which) } -' < $1_struc.txt >> $1_struc.tex 2>mtt_error.txt +' >> $1_struc.tex 2>mtt_error.txt # Now invoke the standard error handling. #mtt_error mtt_error.txt