#! /bin/bash

if [ -d /home/teTex/bin ]
then
	export PATH=/home/teTex/bin:$PATH
fi

set +x 

# $B8E$$%I%-%e%a%s%H$N:o=|(B
rm -rf html

# $B%I%-%e%a%s%H$N%G%#%l%/%H%j:n@.(B
mkdir html
mkdir html/index
mkdir html/image

# tex$B%U%!%$%k$N0\F0(B
for file in *.tex
do
	nkf -e $file > html/$file
done

# $B2hA|%U%!%$%k$N0\F0(B
cp *.png html

# html$B2=$N%3%^%s%I<B9T(B
cd html
ln -s ../latex2html-init .latex2html-init
latex2html -local_icons -show_section_numbers -split 3 -toc_depth 3 -bottom_navigation \
  -noaddress index.tex

echo 0
