15.11.2023
Note to Self: Printing PDFs from HTML documents is still cumbersome in 2024
What works:
- @page helps to style the page layout.
- break-after helps to add page-breaks before or after important elements, such as figures, tables, chapters.
What doesn't work in 2024:
- You can't have a proper header or footer without hacks, such as this combination of a sticky header & footer with a table, because margin at-rules are not implemented in modern browsers. One finds these as solutions in quite a few StackOverflow answers, but you need other software to actually render them, such as Paged.js.
- There is no simple way to have the total number of pages in a CSS variable / counter.
- The CSS page counter thing didn't work for me in Firefox 127.