#! /bin/sh


bigpdf="../icd01_11.pdf"
# note that this second version is not currently linked as there is a separate icd00s set of notes
summarypdf="../icd01_11_summary.pdf"

pdf_file_list=""
summary_pdf_file_list=""

if [ ! -f `basename $0` ]
then
  echo "Please run from directory containing script"
  exit
fi
rm -f ${bigpdf}
rm -f ${summarypdf}
rm -f *.pdf

for n in 01 02 03 04 05 06 07 08 09 10 11
do
  cp -p ../../pdf4/icd${n}.pdf lecture_${n}.pdf
  pdf_file_list="$pdf_file_list lecture_${n}.pdf"
  cp -p ../../pdf/icd${n}_summary.pdf lecture_${n}_summary.pdf
  pdf_file_list="$pdf_file_list lecture_${n}_summary.pdf"
  summary_pdf_file_list="$summary_pdf_file_list lecture_${n}_summary.pdf"
done

# echo $pdf_file_list
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
   -sOutputFile="${bigpdf}" ${pdf_file_list}

# echo $summary_pdf_file_list
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
   -sOutputFile="${summarypdf}" ${summary_pdf_file_list}
