Package geometry allows specification of paper height, e.g., \geometry{paperheight=782mm},
What about dynamically adjusting paper height — How to dynamically increase paper height, rather than breaking pages?
LaTeX has page breaking logic, tweak to increase paper height by length necessary to avoid break.
\enlargethispagecommand? – Mico Jul 11 '23 at 09:46\smashtogether with forcing a manual pagebreak? – Ingmar Jul 11 '23 at 09:53