   on error return
   define character text1*80 text2*80 text3*80  text4*80 text5*80
   sic user
   sic date
   sic out 'proj'.tex1
   say "%------------------------------------------------------------------"
   say "%" 'proj'.tex
   say "%  Project technical file created by " 'sys_info'  'sys_date'
   say "%------------------------------------------------------------------"
   SAY "\documentclass[rl,11pt]{article}"
   say "\usepackage{graphicx}"
   SAY "\sloppy"
   SAY "\title {Project "'PROJ'" Technical File}"
   say "\date{"'sys_date'"}"
   SAY "\author{"'sys_info'"}"
   SAY "\begin{document}"
   SAY "\maketitle"
   SAY "\section{Astronomer Input}"
   say 'n_sources'" sources :\\[1ex]"
   say "\begin{tabular}{llrrr}"
   say "& Source & $\alpha$(J2000) & $\delta$(J2000) & $V$(LSR, km/s) \\"
   for i 1 to n_sources
      let text1 sourcename_'i' /format a12
      let text2 ra2000_'i'     /format a16
      let text3 dec2000_'i'     /format a16
      let text4 vlsr_'i'        /format f10.3
      say 'i' & 'text1' & 'text2' & 'text3' & 'text4' \\
      if nfield_'i'.gt.1 then
         let text1 nfield_'i' /format a4
         say && Mosaic of 'text1' fields && \\
         let text2 xfield_'i' /format a80
         say && X & 'text2' & \\
         let text2 yfield_'i' /format a80
         say && Y & 'text2' & \\
         let text2 tfield_'i' /format a80
         say && T & 'text2' & \\
      endif
   next
   say "\end{tabular}\\[1ex]"
   say 'n_cont'" Continuum Tables :\\[1ex]"
   say "\begin{tabular}{lll}"
   say "& Table & Bands \\"
   for i 1 to n_cont
      let text1 conttable_'i' /format a80
      let text2 contbands_'i' /format a80
      say 'i' & 'text1' & 'text2' \\
   next
   say "\end{tabular}\\[1ex]"
   say 'n_line'" Line Tables :\\[1ex]"
   say "\begin{tabular}{llllll}"
   say "& Table & Line & Freq & Vel. & $\Delta v$ \\"
   for i 1 to n_line
      let text1 linetable_'i' /format a80
      let text2 linename_'i' /format a80
      let text3 linefreq_'i' /format f16.3
      let text4 linevelo_'i' /format a80
      let text5 linevres_'i' /format f16.3
      say 'i' & 'text1' & 'text2' & 'text3' & 'text4'  & 'text5' \\
   next
   say "\end{tabular}\\"
   say  " \section{Calibrators}"
   say "\begin{tabular}{lllll }"
   say "& Name & Flux & Distance \\"
   for i 1 to calib_n
      say 'i' " & " 'calib_name[i]' " & " calib_flux[i] " & " calib_dist[i] " \\ " -
      /format i2 a a12 a f5.2 a f5.2 a
   next
   say "\end{tabular}\\[1ex]"
   say "\includegraphics[width=10cm,angle=-90]{"'proj'"-calibrators}"
   say "\section{Receiver 1 setup}"
   say "\includegraphics[width=10cm,angle=-90]{"'proj'"-receiver-1}"
   say "\section{Receiver 2 setup}"
   say "\includegraphics[width=10cm,angle=-90]{"'proj'"-receiver-2}"
   say "\section{Observing procedure}"
   say "\begin{verbatim}"
   sic out
   sic out 'proj'.tex2
   say "\end{verbatim}"
   say "\end{document}"
   sic out
!
!
if SIC%VERSION.EQ."HPUX" then
  sic\system "cat "'proj'".tex1 > "'proj'".tex"
  sic\system "cat  setup-"'proj'".obs >> "'proj'".tex"
  sic\system "cat "'proj'".tex2 >> "'proj'."tex"
  sic\system "latex "'proj'".tex"
  sic\system "dvips -o "'proj'".ps "'proj'
  sic\system "chmod g+w "'proj'"*.*"
!else if SIC%VERSION.EQ."WIN32" then
!  sic\system "latex "'proj'".tex"
!  sic\system "dvips -o "'proj'".ps "'proj'
else
  say "... not yet available for "'SIC%VERSION'
endif
sic\say "I-PRINT, Postcript report is "'proj'".ps"
