Differences From Artifact [d9744948f9]:

To Artifact [6003f8f14a]:


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
# Copyright (c) P.J.Gawthrop, 1997.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



# 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_struc.tex"

rm -f mtt_error

#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
sed 's/_/\\_/g' < $1_struc.txt |  gawk '
#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 "  \\begin{tabular}{|l|l|l|l|}";  print "    \\hline";
  print "     & Component & System & Repetition \\\\";
  print "    \\hline";
}

function footer(what){
  print "    \\hline";

  print "  \\end{tabular}";
#  print "  \\caption{" what "}";
  print "\\end{table}";
  print "   \\bigskip";
  print "   \\bigskip";
}

BEGIN{
Which=""
}







>
>
>


















|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
>
|
|
>
|
|
|
<
>


>
|

|







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
# Copyright (c) P.J.Gawthrop, 1997.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
# 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_struc.tex"

rm -f mtt_error

#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 awk
sed 's/_/\\_/g' < $1_struc.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|l|l|}";  print "    \\hline";
#  print "     & Component & System & Repetition \\\\";
#  print "    \\hline";

#}
function footer(what){
  print "    \\hline";
  print "  \\end{supertabular}";
#  print "  \\end{tabular}";
#  print "  \\caption{" what "}";
#  print "\\end{table}";
  print "   \\bigskip";
  print "   \\bigskip";
}

BEGIN{
Which=""
}

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