#!/bin/bash

sed -i -e 's#\\documentclass#%\\documentclass#' -e '/{document}/ s/^/%/' \
	texfiles/chapters/*.tex
sed -i    '30,${s#\\subfile{#\\include{#g}' \
	NEMO_manual.tex

latex     -shell-escape		NEMO_manual
makeindex 						NEMO_manual
bibtex 							NEMO_manual

latex2html -local_icons -no_footnode -split 4 -link 2 -mkdir -dir html_LaTeX2HTML 	\
				$* 																							\
	NEMO_manual

sed -i -e 's#%\\documentclass#\\documentclass#' -e '/{document}/ s/^%//' \
	texfiles/chapters/*.tex
sed -i    '30,${s#\\include{#\\subfile{#g}' \
	NEMO_manual.tex

exit 0
