After reading and trying for some time I found out, that any conversion to html makes things worse. Reading about how an epub is actually built, lead to the following steps:
- Unzip the epub file (it is a valid zip file just with a different suffix)
- Inside there there are all chapters as
*.xhtml
files and two important filescontent.opf
andtoc.ncx
- Using
toc.ncx
the unwanted xhtml files can be identified (delete the unwantednavPoint
section afterwards) content.opf
contains amanifest
and aspine
section.- In the manifest section an id is assigned to each file. The order of these ids in the spine section is the order in which the chapter files occur in the book.
- Remove the corresponding line from the spine section and the chapter is gone.
- You can then remove the line from the manifest and delete the xhtml file. Everything works without this step, but it is just dead weight.
- Zip it again and change the suffix to epub.
These steps are scriptable well enough for me, so my problem is solved.