#! /bin/sh
# Conversion of a M$word file (iso-8859-1, perhaps declared as -15) 
# to a html form, then made smaller and cleaner

#   Linkname: wvWare, library for converting Word documents
#        URL: http://wvware.sourceforge.net/
# (I have still occasional problems with converting some images, but it's
#  a matter of another libraries probably.)
wvHtml $1 $1.tmp


#  sed is a standard unix tool
# html code to a TeX one, correct information, deleting nonsense infomation,
# approximating various double quotes:
sed "s/line-height: \(.*\)\"/\"/ ; s/cols=\"\(.*\)>/>/ ; \
  s/&bdquo;/,,/g ; s/&ldquo;/\`\`/g ; s/&rdquo;/\'\'/g " \
 $1.tmp >$1.tmp2

# tidy is available (apart from inside debian)
#     Linkname: The World Wide Web Consortium
#        URL: http://www.w3.org/
# tidy is an indispensable tool for getting an editable html 
# from a wild-looking source: 
tidy -c -o -f /dev/null $1.tmp2 >$2
rm $1.tmp

rm $1.tmp2

# Jenik Hollan, http://astro.sci.muni.cz/pub/hollan
