#/bin/bash
#
#clean a latex file for camera-ready submission
#this removes all comments, replaces \def by \newcommand and removes duplicate
#definitions, moreover removes unused definitions and finally flattens all branches
#\newif\ifsomething\somethingtrue ... \ifsomething ... \else (alternative) \fi
#of the latex file
#
#Jan Poland, March 8, 2006
#
cat $1 | cleanltxbase.pl | cleanltxdef.pl | cleanltxbranches.pl >clean.$1

