diff --git a/Makefile b/Makefile
index e44381f..37d78e2 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,10 @@ SUPPORT = chapauth.sty praise.tex
STORIES = stories/*.tex
ART = art/*
+all: pdf epub
+pdf: horrors2-book.pdf
+epub: book.epub
+
horrors2-book.pdf: horrors2-book.ps
ps2pdf $< $@
@@ -18,8 +22,22 @@ horrors2.pdf: horrors2.ltx $(SUPPORT) $(STORIES) $(ART)
pdflatex $<
pdflatex $<
+horrors2.mdwn: horrors2.ltx $(STORIES)
+ ./toxhtml.py > $@
+
+horrors2.xhtml: horrors2.mdwn head.xhtml foot.xhtml
+ cat head.xhtml > $@
+ markdown $< >> $@
+ cat foot.xhtml >> $@
+
+book.epub: horrors2.xhtml
+ ./mkepub
+
+
publish: horrors2.pdf
cp horrors2.pdf horrors2.$(shell TZ=UTC date "+%Y-%m-%dT%H:%M:%SZ").pdf
clean:
rm -f *aux *dvi *log
+ rm -f horrors2.xhtml horrors2.mdwn book.epub
+ rm -f epub/art/*
diff --git a/epub/AntykwaTorunska-Bold.otf b/epub/AntykwaTorunska-Bold.otf
new file mode 100644
index 0000000..5273a43
Binary files /dev/null and b/epub/AntykwaTorunska-Bold.otf differ
diff --git a/epub/AntykwaTorunska-Italic.otf b/epub/AntykwaTorunska-Italic.otf
new file mode 100644
index 0000000..efb6fa7
Binary files /dev/null and b/epub/AntykwaTorunska-Italic.otf differ
diff --git a/epub/AntykwaTorunska-Regular.otf b/epub/AntykwaTorunska-Regular.otf
new file mode 100644
index 0000000..119df17
Binary files /dev/null and b/epub/AntykwaTorunska-Regular.otf differ
diff --git a/epub/META-INF/container.xml b/epub/META-INF/container.xml
new file mode 100644
index 0000000..492a78b
--- /dev/null
+++ b/epub/META-INF/container.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
diff --git a/epub/book.ncx b/epub/book.ncx
new file mode 100644
index 0000000..7fd88ea
--- /dev/null
+++ b/epub/book.ncx
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Horrors 2
+
+
+
+
+ Chapter 1
+
+
+
+
+
diff --git a/foot.xhtml b/foot.xhtml
new file mode 100644
index 0000000..308b1d0
--- /dev/null
+++ b/foot.xhtml
@@ -0,0 +1,2 @@
+