Fixed generation of doc with titles and toc

I think that the previous problem was stupidly writing in a file that pyPdf
still needed to read. Doh! Anyway, now the way it works is less magic: instead
of interacting with the frame hacking its page count generate empty pages. It's
also easier to keep track of them when we merge the docs.