#!/bin/csh -f
#++++++++++++++++
#.IDENTIFICATION getmeth
#.LANGUAGE       display(?)
#.AUTHOR         CDS Catalogues Service
#.ENVIRONMENT    
#.KEYWORDS       
#.VERSION  1.0   05-Dec-1999: Creation
#.PURPOSE        Display CADARS Methods
#.COMMENTS       Argument = Method number (not required)
#----------------

if ($#argv >= 1) then
    set themeth = $1 ; shift
else
    set themeth = 100
endif

@ skip = $1 * 1024 - 1023

if ($?HTTP_HOST) then
    echo "\section{List of Methods used for Diameter Determinations}"
    echo "\begin{alltty}"
endif

# Boldface the meth number
gawk -v meth=$themeth 'function reset(){\
      if(show==2) {show--; printf("}")} } \
   /^Methods/{ show=1; next} \
   /^[A-Z]/{if (show>0)exit} \
   /^$/  {reset(); next}  END{reset() } \
   /^  *--*$/{ if(show==0)next; reset(); print "\\hr"; next}\
   {if(show==0) next; \
    if ($1 == meth) { show=2; printf "\\label{m%s}{\\bf\\fg{red4}", meth}\
   print }' ReadMe

if ($?HTTP_HOST) echo "\end{alltty}"
exit 0

