Index: mttroot/mtt/bin/trans/rbg_fig2m ================================================================== --- mttroot/mtt/bin/trans/rbg_fig2m +++ mttroot/mtt/bin/trans/rbg_fig2m @@ -13,10 +13,13 @@ ############################################################### ## 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 @@ -71,10 +74,46 @@ 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;i0)&&(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" @@ -81,10 +120,11 @@ 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 @@ -131,14 +171,16 @@ #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_art.fig >> $1_labg.fig +strip_comments < $1_lart.fig >> $1_labg.fig