-Kate-the-Empress.html: $(wildcard *.tex)
- cp book.tex Kate-the-Empress.tex
- latex2html -no_navigation -split=0 -no_subdir -prefix=Kate-the-Empress Kate-the-Empress.tex
- sed -i.bak -e 's/ -- /\ \— /g' -e 's/ --$$/\ \—/' -e 's/^-- /\— /' Kate-the-Empress.html
- rm Kate-the-Empress.tex
+Kate-the-Empress.html: onefile.tex
+ pandoc -t html --toc --standalone -o $@ $+
+
+Kate-the-Empress.epub: onefile.tex
+ pandoc -t epub --toc --standalone -o $@ $+
+
+onefile.tex: joinfiles.awk $(wildcard *.tex)
+ awk -f joinfiles.awk book.tex > $@
+
+clean:
+ rm -f onefile.tex book.log book.aux book.out book.toc