Index: mttroot/mtt/bin/trans/lbl_txt2tex ================================================================== --- mttroot/mtt/bin/trans/lbl_txt2tex +++ mttroot/mtt/bin/trans/lbl_txt2tex @@ -12,10 +12,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.8 1999/02/17 21:42:19 peterg +## Replaced print by printf to avoid extra nl in paragraph command. +## ## Revision 1.7 1998/07/27 12:56:26 peterg ## Splits up | separated expressions. ## ## Revision 1.6 1998/07/27 10:56:31 peterg ## Cosmetics. @@ -79,20 +82,54 @@ if (match($4,"[\#\%]")==1) printf(" -- "); for (j=5;j<=NF;j++) printf(" %s", $j) printf("\n"); } } - END{if (NR==0) print "\\item This component has no aliases" + END{if (NR==0) print "\\item This component has no ALIAS declarations" +}' | sort >> $1_lbl.tex +cat <> $1_lbl.tex +\end{description} +EOF + +#Write out the VARS +cat <> $1_lbl.tex +\paragraph{Variable declarations:} +\begin{description} +EOF + grep '[%|#][V|P]AR' $1_lbl.txt | sed 's/_/\\_/g' |\ + awk '{ + printf("\\item %s\n",$2) + } + END{if (NR==0) print "\\item This component has no PAR declarations" }' | sort >> $1_lbl.tex cat <> $1_lbl.tex \end{description} EOF + +#Write out the UNITS +cat <> $1_lbl.tex +\paragraph{Units declarations:} +\begin{description} +EOF + grep '[%|#]UNITS' $1_lbl.txt | sed 's/_/\\_/g' |\ + awk '{ + printf("\\item [Port %s] has domain %s\n",$2, $3) + printf("\\begin{description}\n") + printf("\\item [Effort units] %s\n",$4) + printf("\\item [Flow units] %s\n",$5) + printf("\\end{description}\n") + } + END{if (NR==0) print "\\item This component has no UNITs declarations" +}' >> $1_lbl.tex +cat <> $1_lbl.tex +\end{description} +EOF