Actually produce the right latex for the entire toctree, not just
a little bit, so that the PDF generation works correctly.

Fixes #126