Overview
Comment:Initial revision
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 3c1724c03baa3450ef54ad15c1711143564466f7369c03deba441d6b463a3b19
User & Date: gawthrop@users.sourceforge.net on 2000-11-27 15:11:15
Other Links: branch diff | manifest | tags
Context
2000-11-27
17:45:00
Removed "System" from heading check-in: 2209f320b4 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
15:11:15
Initial revision check-in: 3c1724c03b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
11:52:10
Changed some greps to be case insensitive check-in: 8b420accf7 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/bin/trans/abg2tex version [79f8f6cf8e].













































































































































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#!/bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: abg2tex
# Creates a tex file describing the system abg
# P.J.Gawthrop May 1997
# Copyright (c) P.J.Gawthrop, 1997.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.7  1997/12/06 16:20:37  peterg
## Added another argument - the label
##
## Revision 1.6  1997/12/06 15:49:35  peterg
## Changed order of fig arguments to put filename first.
##
## Revision 1.5  1997/08/15 11:32:05  peterg
## Removed an echo left in by mistake
##
# Revision 1.4  1997/08/15  11:19:25  peterg
# Minto cosmetics.
#
## Revision 1.3  1997/05/21 12:07:22  peterg
## Replaced echo by cat -- much simpler.
##
## Revision 1.2  1997/05/19 16:25:53  peterg
## Explicit include of tex files .. latex2html seems to prefer this!
##
# Revision 1.1  1997/05/19  11:30:00  peterg
# Initial revision
#
###############################################################

#Look for a command line argument
while [ -n "`echo $1 | grep '^-'`" ]; do
  case $1 in
	-pdf )  pdf='-pdf'
                ;;

	*)
		echo "$1 is an invalid argument - ignoring" ;;
  esac
  shift
done


if [ -z "$2" ]; then
  filename="$1_abg.tex";
  echo > $filename
  echo Creating $filename
  subsection='section'
else
  filename=$2
  subsection='subsection'
fi


#Section heading (if not at top level)
if [ -n "$2" ]; then
cat<<EOF >> $filename

%% Subsystem $1
  \subsection{System \textbf{$1}}
    \label{sec:$1}
    \index{\textbf{$1} -- abg} 

EOF
else
mtt -q -u $1 abg m # Make sure all the subsystems exist -- nasty kludge
cat<<EOF > $filename
   % abg report for system $1 ($filename)
   % Generated by MTT at `date`
EOF
fi

# Figure
##echo mtt -q -u $pdf $1 abg ps
mtt -q -u  $pdf $1 abg ps
cat <<EOF  >> $filename

   \fig{`pwd`/$1_abg}{$1_abg.ps}{0.9}{System \textbf{$1}: acausal bond graph}

EOF

# Description
mtt -q -u $1 desc tex
# Put in absolute pathnames in figures -- and fix bug in old desc files
sed "s;fig{;fig{`pwd`/;g" < $1_desc.tex |\
sed "s/Ref{$1_abg}/Ref{fig:$1_abg.ps}/" >> $filename

# Label file
mtt -q -u $1 lbl tex
cat<<EOF  >> $filename
 \sub$subsection{Summary information} 
 \label{sec:$1_lbl} 
 \index{\textbf{$1} -- lbl} 
EOF
cat $1_lbl.tex   >> $filename


# CRs
#mtt -q -u $1 cr tex
#cat<<EOF  >> $filename
# \sub$subsection{Constitutive relationships} 
# \label{sec:$1_cr} 
# \index{\textbf{$1} -- cr} 
#EOF
#cat $1_cr.tex   >> $filename

# Subsystems
mtt -q -u $1 sub tex 
cat<<EOF  >> $filename
 \sub$subsection{Subsystems} 
 \label{sec:$1_sub} 
 \index{\textbf{$1} -- subsystems} 
EOF
cat $1_sub.tex   >> $filename

#Now do the subsystems (if at top level)
if [ -z "$2" ]; then
 sub2subs $1 | sort -u | \
  awk '{print "abg2tex", pdf, $1, filename}' pdf=$pdf filename=$filename | sh
fi












MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]