Ivan, could you share a little about your toolchain writing this book? There's been a lot of traffic on HN around self publishing and I think it would be of interest.
OK, so I have a blog post in the works but since that is taking too long I will say a few words here briefly. Basically I use:
dokuwiki | dokutexit | sed (cleanup) | pdflatex
DokuWiki is a file-system based wiki which I run on localhost. Each section is one .txt file. To generate the book I made a master file which includes all necessary sections. The plugin dokutexit then produces the .tex output. Dokutexit does a good job, but I still there is some cleanup necessary (via sed). I also do some manual touchups by adding the front matter / back matter stuff (via \input{subfile.tex}) and then pdflatex does its magic.
The latex document class is extbook -- the regular book class does not have the 9pt option.
@READERS Sorry for inflicting upon you the 9pt font. I know it is tiny, but look at how small and portable the book is now ;)
____
I am still researching how to generate .epub and .mobi form latex files. If anyone has pointers to articles which discuss this, I would be very interested to hear. PM me, or post them here so that everyone can learn. (plasTeX? MathJax? MathML?)
P.S. I'll buy it in ebook form!