After you use Eric’s method, or the Kin filter (hmm, could that be written now in wikitext?) to flatten your structure, you still have the problem of printing it out intelligently. For me, browser print-to-pdf works very poorly, especially in terms of pagination. Most of the them treat your entire document like a giant image, and then “paginate” by cutting it at regular intervals. This means that pagination can occur in the middle of an image, the middle of a paragraph, or even split a line along a horizontal axis. This is one area where some AI assistance would be welcome.
For nice looking documents, I find it necessary to copy the flattened text out to a word processor, and then go through and apply my own pagination, along with any other tweaks (like resizing or floating images).