Why not use a format like Docbook and _generate_ other formats from it? AFAIK, from Docbook you can generate PS, PDF, RTF, HTML. Docbook is used widely for technical documentations, so why not use it for textbooks as well?
Volker
textbook-l@lists.wikimedia.org