ADDED mttroot/mtt/bin/trans/makedoc Index: mttroot/mtt/bin/trans/makedoc ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/makedoc @@ -0,0 +1,120 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: makedoc +# Encapsulates a tex file in a document. + +# P.J.Gawthrop August 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1997/05/17 13:55:42 peterg +## Initial revision +## +# Revision 1.2 1997/04/23 10:06:51 peterg +# Put output in the correct file! +# +# Revision 1.1 1997/04/23 10:03:41 peterg +# Initial revision +# +############################################################### + +date=`date` +switches=$1 +system=$2 +representation=$3 +lang=$4 +args=$5 +documenttype=$6 +ps=$7 + +if [ "$documenttype" = "book" ]; then + document=book +else + document=article +fi + +if [ "$documenttype" = "book" ]||[ "$documenttype" = "article" ]; then + title="\title{Report on $system}" +else + title="\title{System $system, representation $representation}" +fi + +filename=$2_$3.doc +texname=$2_$3.tex +indexname=$2_$3.ind + +# Inform user +echo "Creating $filename" +# Make arguments acceptable to LateX +Args=`echo $args | sed 's/_/\\\_/g'` + +cat< $filename +\nonstopmode +\documentclass[12pt,a4paper]{$document} + $title + \author{Generated by MTT using :\\\\ + (mtt $switches $system $representation $lang $Args)} + \date{$date} +EOF + +if [ "$documenttype" = "book" ]; then + cat <> $filename + \makeindex +EOF +fi + +cp -v $MTTPATH/trans/*.sty . +cat >> $filename <> $filename +\begin{document} + \maketitle +EOF + +if [ "$documenttype" = "book" ]||[ "$documenttype" = "article" ]; then + cat $MTTPATH/trans/contents.tex >> $filename +fi + +cat <> $filename +%Fancy headings + \pagestyle{fancy} + \renewcommand{\sectionmark}[1]{\markboth{#1}{}} + \lhead{Report \textbf{$system}} + \rhead{Representation \textbf{$representation}} + \rfoot{Page \thepage.}\cfoot{} + \lfoot{\emph{$date}} + + \input{$texname} +EOF + +if [ "$documenttype" = "book" ]; then + cat <> $filename + \input{$indexname} +EOF +fi + +cat<> $filename +\end{document} +EOF + + + + + + + + + + + + ADDED mttroot/mtt/bin/trans/ode_r2tex Index: mttroot/mtt/bin/trans/ode_r2tex ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/ode_r2tex @@ -0,0 +1,121 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ode_r2tex +# Reduce differential-algebraic to LaTex differential-algebraic equations. +# P.J.Gawthrop 10th May 1991, April 1994 +# Copyright (c) P.J.Gawthrop, 1991, 1994, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 1998/01/23 15:51:01 peterg +## Repleace eqnarray by equation + aligned -- this works with Latex2html +## +## Revision 1.2 1996/12/20 08:59:10 peterg +## Now writes out mtti instead of mtt_{i} -- lets latex_tidy do the +## conversion. +## +## Revision 1.1 1996/12/20 08:53:57 peterg +## Initial revision +## +############################################################### + +# Inform user +echo Creating $1_ode.tex + +# Remove the old log file +rm -f ode_r2tex.log + +# Use reduce to accomplish the transformation +reduce >ode_r2tex.log << EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the differential-algebraic equations file +in "$1_ode.r"; + +%Read the symbolic parameter file +%%in "$1_sympar.r"; + + + +OFF Echo; +OFF Nat; + +%Read the substitution file +IN "$1_subs.r"; + +%Read the simplifying expressions file +IN "$1_simp.r"; + +OUT "$1_ode.tex"; + +%Write out the differential-algebraic equations. + +write "%File: $1_ode.tex"; + +write "%ordinary differential equations"; +write "% Generated by MTT"; + +IF MTTNx>0 THEN +BEGIN + write"\begin{equation} \label{eq_$1_ode_x}"; + write"\begin{aligned}"; + FOR Row := 1:MTTNx DO + BEGIN + write "\dot MTTX", Row, " &= "; + write "{"; + write MTTdx(Row,1); + write "}"; + IF Row0 THEN +BEGIN + write"\begin{equation}"; + write"\begin{aligned}"; +FOR Row := 1:MTTNyz DO + BEGIN + write "0 &= "; + write "{"; + write MTTyz(Row,1); + write "}"; + IF Row0 THEN +BEGIN + write"\begin{equation} \label{eq_$1_ode_y}"; + write"\begin{aligned}"; + FOR Row := 1:MTTNy DO + BEGIN + write "MTTy", Row, " &= "; + write "{"; + write MTTy(Row,1); + write "}"; + IF Row1) + part = a[N-1]; + if (length(part)>0) + if (part!=oldpart) + printf("\\part{\\textbf{%s}}\n", part); + oldpart=part; + printf("\\chapter{\\textbf{%s}}\n", $(NF-2)); + printf("\\label{chap:%s(%s)}\n", $(NF-2), directory); + printf("\\input{%s/%s_rep}\n\n", directory, $(NF-2)); + }' > $1_rep.tex + + +else # do article and section version + +if [ -z "$3" ]; then + directory=""; +else + directory=$3/; +fi + +# Inform user +echo "Creating $1_rep.tex" + +# Create the LaTeX file +strip_comments <$1_rep.txt |\ +awk ' +{ + ## Count the switches (noting that -i has an argument) + Switches=0; + for (i=2;i<=NF;i++) { + if (match($i,"-")==1) Switches++; + if (match($i,"-i")==1) Switches++; + } + + System = $(Switches+2) + Representation = $(Switches+3); + Multiple = "odes odeso sms smso daes daeso"; + Language = $(Switches+4); + Languages = "tex txt r m c h ps icad"; + args = $(Switches+5); + quote = "\047"; + args = gensub(quote, "", "g", args); + args = gensub(/"/, "", "g", args); +# args = substr(Args,2,length(Args)-2); +# if ( (length(Args)>0)&&(match(Multiple,Representation)>0)) { + if ( (length(args)>0)&&(match(Language,"ps")>0)) { + _Args = sprintf("-%s", args); + __Args = sprintf("-%s", gensub(/_/, "-", "g", args) ); + ___Args = sprintf("-%s", gensub(/,/, "-", "g", args) ); + } + else + { + _Args = ""; + __Args = ""; + ___Args = ""; + } +# print "DEBUG", Language, args, _Args, __Args + RepLang = sprintf("%s%s.%s", Representation, __Args, Language); + SysRepLang = sprintf("%s_%s", System, RepLang); + SysRep = sprintf("%s_%s%s", System, Representation, _Args); + filename = gensub(/,/, "-", "g", SysRep); + section_head = sprintf("\\textbf{%s.%s}: System %s, representation \\textbf{%s%s}, language \\textbf{%s}", + Representation,Language,System,Representation,__Args,Language); + +# section headings + if (match(Languages,Language)>0) { + print "\n\n\\section{" section_head "}"; + print "\\label{sec:" SysRepLang "}"; + print "\\index{\\textbf{" System "} -- " Representation "}"; + + print "\n\nMTT command:"; + print "\\begin{verbatim}"; + for (i=1;i<=NF;i++) printf("%s ", $i); + print "\n\\end{verbatim}"; + } + +# tex files + if( match("tex",Language)>0) { + printf(" \\input{%s/%s_%s.%s}\n", PWD, System, Representation, Language); +# command = sprintf("sed s!fig{!fig{%s! < %s_%s.%s", Directory, System, Representation, Language); +# system(command); +} + +# text files + if( match("txt r m c h icad",Language)>0) { + print " \\begin{verbatim}"; + command = sprintf("cat %s_%s.%s", System, Representation, Language); + system(command); + print " \\end{verbatim}"; + } +# ps files + if( match("ps",Language)>0) { + printf("This representation is given as Figure \\Ref{fig:%s}.\n", SysRepLang); + FileName = sprintf("%s/%s", PWD, filename); + Label = sprintf("%s", SysRepLang); + Caption = sprintf("System \\textbf{%s}, representation %s%s", System, Representation, __Args); + printf("\\fig{%s}\n {%s}\n {0.9}\n {%s}\n",FileName,Label,Caption); + } +} +END { + +}' system=$1 Directory=$directory PWD=`pwd` > $1_rep.tex + +fi + + + + + + + ADDED mttroot/mtt/bin/trans/sm_r2tex Index: mttroot/mtt/bin/trans/sm_r2tex ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/sm_r2tex @@ -0,0 +1,97 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sm_r2tex +# Reduce constrained-state matrices to LaTex constrained-state matrices. +# P.J.Gawthrop 9 Sep 1991, May 1994 +# Copyright (c) P.J.Gawthrop, 1991, May 1994, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.4 1998/02/18 08:25:36 peterg +## Now uses latex_matrix for formatting +## +## Revision 1.3 1997/06/13 13:50:11 peterg +## Matrices in amstex format +## +# Revision 1.2 1997/04/18 12:54:00 peterg +# No longer does labels. +# +# Revision 1.1 1996/08/19 15:19:23 peter +# Initial revision +# +############################################################### + + +# Inform user +echo Creating $1_$2.tex + +# Remove the old log file +rm -f sm_r2tex.log + +# Use reduce to accomplish the transformation +reduce >sm_r2tex.log << EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the constrained-state matrices file +in "$1_$2.r"; + +%Read the symbolic parameters file +%%in "$1_sympar.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +OFF Echo; +OFF Nat; + +MATRIX MTT_Matrix(MTTNx,MTTNx); + +OUT "$1_$2.tex"; + +%Write out the state matrices. +write "%state matrices $1"; +write "%File: $1_$2.tex"; +write""; + +MTT_Matrix := MTTA$ +MTT_Matrix_name := "MTTA"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTB$ +MTT_Matrix_name := "MTTB"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNu$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTC$ +MTT_Matrix_name := "MTTC"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTD$ +MTT_Matrix_name := "MTTD"$ +MTT_Matrix_n := MTTNu$ +MTT_Matrix_m := MTTNu$ +LaTeX_Matrix()$ + +SHUT "$1_$2.tex"; +quit; +EOF ADDED mttroot/mtt/bin/trans/ss_r2tex Index: mttroot/mtt/bin/trans/ss_r2tex ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/ss_r2tex @@ -0,0 +1,93 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ss_r2tex +# Reduce transfer-function matrices to LaTex transfer-function matrices. +# P.J.Gawthrop 9 June 1990, 8 July 1990, May 1994 +# Copyright (c) P.J.Gawthrop, 1990, 1994. + + + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.2 1998/02/24 09:21:36 peterg +# %% Put under rcs +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +#Unform user +echo Creating $1_ss.tex + +# Remove the old log file +rm -f ss_r2tex.log + +# Use reduce to accomplish the transformation +reduce >ss_r2tex.log << EOF + + +%Read the definitions file +in "$1_def.r"; + +%Read the parameter file +%%in "$1_sympar.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplifiy file +in "$1_simp.r"; + +%Read the CR file +in "$1_cr.r"; + +%Read the steady-state file +in "$1_ss.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +OFF Echo; +OFF Nat; +%ON Rounded; +%Precision 5; + +OUT "$1_ss.tex"; +write "% - X0"; +MTT_Matrix := MTTX$ +MTT_Matrix_name := "MTTX"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := 1$ +LaTeX_Matrix()$ + +write "% - U"; +MTT_Matrix := MTTU$ +MTT_Matrix_name := "MTTU"$ +MTT_Matrix_n := MTTNu$ +MTT_Matrix_m := 1$ +LaTeX_Matrix()$ + + +write "% - Y"; +MTT_Matrix := MTTY$ +MTT_Matrix_name := "MTTY"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := 1$ +LaTeX_Matrix()$ + +write "% - dX"; +MTT_Matrix := MTTdX$ +MTT_Matrix_name := "MTTdX"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := 1$ +LaTeX_Matrix()$ + +SHUT "$1_ss.tex"; +quit; +EOF ADDED mttroot/mtt/bin/trans/sub_sh2tex Index: mttroot/mtt/bin/trans/sub_sh2tex ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/sub_sh2tex @@ -0,0 +1,139 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sub_sh2tex +# Converts _sub_sh files to a latex itemized list. +# P.J.Gawthrop May 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.7 1998/02/04 10:59:37 peterg +## Tidied up. +## +# Revision 1.6 1997/09/08 19:42:37 peterg +# Replaced copy by compcopy +# +## Revision 1.5 1997/08/15 11:20:13 peterg +## Explicitly copies compound components (if not already there) +## +# Revision 1.4 1997/06/24 08:28:26 peterg +# Now takes %SUMMARY description from the label file +# Appends count of number of subsystems at that level +# +## Revision 1.3 1997/05/21 10:07:36 peterg +## Fixed \ probs for GNU sh/echo +## +## Revision 1.2 1997/05/19 16:46:17 peterg +## *** empty log message *** +## +# Revision 1.1 1997/05/19 11:29:44 peterg +# Initial revision +# +############################################################### + + +#Useful strings +quote="'"; +listtype="itemize" + +# Maximum list depth - maybe I should learn sh arithmetic!! +# Just go to two levels +maxlevel='0+1+1'; + +#Look for a command line argument +labels=''; arg=''; +while [ -n "`echo $1 | grep '-'`" ]; do + case $1 in + -l ) + labels='yes'; arg='-l' ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + + +system=$1 +filename=$2 + + +if [ -z "$3" ]; then + level=0; +else + level=$4; +fi + +#Top-level commands +if [ -z "$2" ]; then + filename="$1_sub.tex" + + # Inform user + echo "Creating $filename" + + #Write some file headers + echo "% Subsystem file for system $system ($filename)" > $filename + echo "% Generated by MTT at `date`" >> $filename + echo >> $filename +fi + +# Write list item if not at the top level. +if [ -n "$2" ]; then + #Set up some names + filename=$2 + figfile=$3_abg.fig + lblfile=$1_lbl.txt + summary='%SUMMARY' + + #Get the system description, copying where necesary + mtt -q -u compcopy $system $MTTPATH/lib/comp/compound + # mtt -q -u $system lbl txt + desc=`grep $summary $lblfile | sed "s/$summary//"` + + #Count the number of subsystems + subs=`grep -c $system $figfile` + + if [ "$labels" = "yes" ]; then + echo ' \item '$desc ' ('$subs') Section \Ref{sec:'$system'}' >> $filename + else + echo ' \item' $desc ' ('$subs')' >> $filename + fi +fi + +# Create the subsystem sh files (if not too deep) +if [ "$level" != "$maxlevel" ]; then + mtt -q -u -l 1 $system sub sh + + # Write the list of subsystems (if they exist). + n_subsystems=`grep -c '$1' $1_sub.sh` + + if [ "$n_subsystems" != "0" ]; then + cat <> $filename + \begin{$listtype} +EOF + # Recursively generate the subsystems + level1="$level+1" + sh $system\_sub.sh "sub_sh2tex $arg " " $filename $system $level1" + cat <> $filename + \end{$listtype} +EOF +else + cat <> $filename + No subsystems. +EOF +fi +fi + + + + + + + + ADDED mttroot/mtt/bin/trans/sympar_txt2tex Index: mttroot/mtt/bin/trans/sympar_txt2tex ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/sympar_txt2tex @@ -0,0 +1,93 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sympar_txt2tex + +# Sympar file - text to TeX table conversion +# P.J.Gawthrop April 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1998/01/19 14:17:26 peterg +## Modified struc_txt2tex to make this. +## +## Revision 1.1 1998/01/19 14:16:39 peterg +## Initial revision +## +# Revision 1.3 1997/12/06 19:10:41 peterg +# Reverted to tabular --- from supertabular +# +# Revision 1.2 1997/04/15 11:17:58 peterg +# Uses supertabular for long tables. +# +# Revision 1.1 1997/04/15 09:49:04 peterg +# Initial revision +# +############################################################### + + +# Inform user +echo "Creating $1_sympar.tex" + +rm -f mtt_error + +#Write some file headers +echo "%% Parameter file ($1_sympar.txt)" > $1_sympar.tex +echo "%% Generated by MTT at `date`" >> $1_sympar.tex + +# This is the main transformation using awk +sed 's/_/\\_/g' < $1_sympar.txt | awk ' +#function header(what){ +# print " \\centering"; +# print " \\tablefirsthead{\\hline %"; +# print " \\multicolumn{4}{|c|}{\\bf List of " what "s for system " SYSTEM "} \\\\"; +# print " \\hline"; +# print " & Component & System & Repetition \\\\"; +# print " \\hline}"; +# +# print " \\tablehead{\\hline %"; +# print " \\multicolumn{4}{|c|}{\\bf List of " what "s for system " SYSTEM " (continued)} \\\\"; +# print " \\hline"; +# print " & Component & System & Repetition \\\\"; +# print " \\hline}"; +# +# print " \\tabletail{\\hline}"; +# print " \\begin{supertabular}{|l|l|l|l|}"; +#} +function header(what){ + print "\\begin{table}[htbp]"; + print " \\centering"; + print " \\begin{tabular}{|l|l|}"; print " \\hline"; + print " Parameter & System\\\\"; + print " \\hline"; +} +function footer(what){ + print " \\hline"; + print " \\end{tabular}"; + print " \\caption{" what "}"; + print "\\end{table}"; + print " \\bigskip"; + print " \\bigskip"; +} +BEGIN{ + header($1); +} +{ + print $1, "&", $2, "\\\\"; +} +END{ + footer("Parameters") +} +' SYSTEM=$1 >> $1_sympar.tex 2>mtt_error.txt + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + ADDED mttroot/mtt/bin/trans/tf_r2tex Index: mttroot/mtt/bin/trans/tf_r2tex ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/tf_r2tex @@ -0,0 +1,129 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: tf_r2tex +# Reduce transfer-function matrices to LaTex transfer-function matrices. +# P.J.Gawthrop 9 June 1990, 8 July 1990, April 1994. +# Copyright (c) P.J.Gawthrop, 1990, 1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1996/12/20 08:59:40 peterg +## Now writes out mtti instead of mtt_{i} -- lets latex_tidy do the +## conversion. +## +## Revision 1.1 1996/11/05 11:01:51 peterg +## Initial revision +## +############################################################### + +#Inform user +echo Creating $1_tf.tex + +# Remove the old log file +rm -f tf_r2tex.log + +# Use reduce to accomplish the transformation +reduce >tf_r2tex.log << EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the parameter file +%%in "$1_sympar.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +%Read the transfer-function matrices file +in "$1_tf.r"; + +%Read the substitution file +IN "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +OFF Echo; +OFF Nat; + +OUT "$1_tf.tex"; +MTT_Matrix := MTTTF$ +MTT_Matrix_name := "MTTG"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := MTTNu$ +LaTeX_Matrix()$ + +%% FOR Row := 1:MTTNy DO +%% BEGIN +%% FOR Col := 1:MTTNu DO +%% BEGIN +%% numerator := num(MTTtf(Row,Col)); +%% denominator := den(MTTtf(Row,Col)); +%% cnumerator := coeff(numerator, s); +%% cdenominator := coeff(denominator, s); +%% write "!begin{equation} !label{eq_$1_tf", Row, Col, "}"; +%% IF MTTNy=1 AND MTTNu=1 +%% THEN +%% write "MTTTF(s) = {" +%% ELSE +%% write "MTTTF", Row, Col, "(s) = {"; +%% IF numerator = 0 +%% THEN write "0" +%% ELSE +%% BEGIN +%% FOR i := 1:Length(cnumerator) DO +%% BEGIN +%% cof := part(cnumerator,i); +%% IF cof NEQ 0 THEN +%% BEGIN +%% IF i>1 THEN write " + "; +%% IF cof NEQ 1 THEN +%% BEGIN +%% IF Terms(cof)>1 THEN write "(", cof, ")" +%% ELSE write cof; +%% END +%% ELSE IF i=1 THEN Write "1"; +%% +%% IF i=2 THEN write "s"; +%% IF i>2 THEN write "s^", i-1; +%% END; +%% END; +%% END; +%% +%% IF denominator NEQ 1 THEN +%% BEGIN +%% Write "!over"; +%% FOR i := 1:Length(cdenominator) DO +%% BEGIN +%% cof := part(cdenominator,i); +%% IF cof NEQ 0 THEN +%% BEGIN +%% IF i>1 THEN write " + "; +%% IF cof NEQ 1 THEN +%% BEGIN +%% IF Terms(cof)>1 THEN write "(", cof, ")" +%% ELSE write cof; +%% END +%% ELSE IF i=1 THEN Write "1"; +%% +%% IF i=2 THEN write "s"; +%% IF i>2 THEN write "s^", i-1; +%% END; +%% END; +%% END; +%% write "}"; +%% write "!end{equation}"; +%% END; +%% END; +%% +SHUT "$1_tf.tex"; +quit; +EOF +