Overview
Comment:Handle descriptive (inc maths) text as well
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 46adbfc048c91da96548192b6e686bc3a2ee7fbd7a886a9b6fcdeedc30dae5de
User & Date: gawthrop@users.sourceforge.net on 2005-03-15 12:49:28
Other Links: branch diff | manifest | tags
Context
2005-03-15
13:36:31
Pretty abg figure in reports. check-in: ccf932283a user: gawthrop@users.sourceforge.net tags: origin/master, trunk
12:49:28
Handle descriptive (inc maths) text as well check-in: 46adbfc048 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
12:04:15
New labg.fig rep - pretty LaTeX figures. check-in: 8741109857 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/rbg_fig2m from [f5625fa473] to [6a70c23123].

11
12
13
14
15
16
17



18
19
20
21
22
23
24
# Copyright (c) P.J.Gawthrop, 1996.

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



## Revision 1.10  2002/04/28 18:55:03  geraint
## Fixed [ 549658 ] awk should be gawk.
## Replaced calls to awk with call to gawk.
##
## Revision 1.9  2002/01/11 03:44:19  geraint
## Breaks compounds objects into individual components. Eliminates "incorrect object code error" in cbg.ps when component is not causally complete.
##







>
>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.11  2005/03/15 12:03:48  gawthrop
## New labg.fig rep - pretty LaTeX figures.
##
## Revision 1.10  2002/04/28 18:55:03  geraint
## Fixed [ 549658 ] awk should be gawk.
## Replaced calls to awk with call to gawk.
##
## Revision 1.9  2002/01/11 03:44:19  geraint
## Breaks compounds objects into individual components. Eliminates "incorrect object code error" in cbg.ps when component is not causally complete.
##
69
70
71
72
73
74
75




































76
77
78
79
80
81
82
83
84
85

86
87
88
89
90
91
92
    printf("%s ",C[i]);
  if (N==1)
    printf("\\\\B{%s}\\001\n",C[M]);
  if (N==2)
    printf("\\\\BB{%s}{%s}\\001\n",C[M],B[2]);
  }'  
}





































# Inform user
echo "Creating $1_rbg.m"
echo "Creating $1_cmp.m"
echo "Creating $1_head.fig"
echo "Creating $1_fig.fig"
echo "Creating $1_cmp.fig"
echo "Creating $1_port.fig"
echo "Creating $1_sabg.fig"
echo "Creating $1_art.fig"



# Remove some files that I'm going to append to.
rm -f $1_fig.fig
rm -f $1_head.fig
rm -f $1_cmp.fig
rm -f $1_port.fig







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>










>







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
    printf("%s ",C[i]);
  if (N==1)
    printf("\\\\B{%s}\\001\n",C[M]);
  if (N==2)
    printf("\\\\BB{%s}{%s}\\001\n",C[M],B[2]);
  }'  
}

art2latex() {
  gawk '{
  ## Is it text?
  is_text="4";
  if ($1!=is_text)
    print $0
  else
  {
  ## Zap trailing null
  split($0,B,"\\");

  ## Split into fields
  M=split(B[1],C);

  ## Set special flag
  FlagCol = 9
  C[FlagCol] = 6;

  ## Write out modified version
  N = 14;
  for (i=1;i<N;i++)
    printf("%s ",C[i]);

  for (i=N;i<=M;i++) {
    if ( (index(C[i],"_")>0)&&(index(C[i],"$")==0) )
      C[i] = sprintf("$%s$", C[i]);
    printf(" %s",C[i]);
  }

  printf("\\001\n");

  }
  }'  
}


# Inform user
echo "Creating $1_rbg.m"
echo "Creating $1_cmp.m"
echo "Creating $1_head.fig"
echo "Creating $1_fig.fig"
echo "Creating $1_cmp.fig"
echo "Creating $1_port.fig"
echo "Creating $1_sabg.fig"
echo "Creating $1_art.fig"
echo "Creating $1_labg.fig"


# Remove some files that I'm going to append to.
rm -f $1_fig.fig
rm -f $1_head.fig
rm -f $1_cmp.fig
rm -f $1_port.fig
129
130
131
132
133
134
135


136
137
138
139
140
141
142
143
144

rm -f $1_abg.mtt

#Create the stripped abg file
cat $1_head.fig $1_bnd.fig $1_cmp.fig> $1_sabg.fig

#Create the latexed abg file


cmp2latex<$1_cmp.fig  >$1_lcmp.fig
cat $1_head.fig $1_bnd.fig $1_lcmp.fig  > $1_labg.fig
strip_comments < $1_art.fig >> $1_labg.fig













>
>


|






169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186

rm -f $1_abg.mtt

#Create the stripped abg file
cat $1_head.fig $1_bnd.fig $1_cmp.fig> $1_sabg.fig

#Create the latexed abg file
##latex_tidy $1_art.fig
art2latex< $1_art.fig  >$1_lart.fig
cmp2latex<$1_cmp.fig  >$1_lcmp.fig
cat $1_head.fig $1_bnd.fig $1_lcmp.fig  > $1_labg.fig
strip_comments < $1_lart.fig >> $1_labg.fig







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