commented: I recently finished writing a (short, 58,000-word) novel. Now I have the problem of formatting it nicely for PDF. Previously, for short stories, I’ve exported from my editor (Scrivener) into .docx format, imported that into Apple’s Pages app, and done a bunch of manual formatting. The obvious problem is that now I can’t make further textual changes in Scrivener, or I’ll have to redo all the formatting. I finally found the solution: export to ePub, then unzip the file — it’s just a bunch of XHTML files, a CSS file and some XML metadata — and customize the stylesheet. Then I open the chapters in a browser, chose Print, and save to PDF. Next time I export, I just drop in the custom stylesheet. Anyway, I’ve gotten the formatting pretty nice — hyphenation, widow/orphan suppression, keeping headers on the same page as the next paragraph… — but I didn’t know how to add page headers and footers with page numbers and chapter titles. Until now. commented: The main trick is using Prince XML which supports several experimental CSS features for paged media, that web browsers do not. commented: I discovered that after I read farther! Excellent tool … although if I want to self-publish this book I’ll have to pony up for the commercial single-user license, which is pretty steep at US$500. commented: I work on Prince. Always nice to see it get a mention. .