Finer control over geometry
Is there any way to have finer control over the geometry of a LaTeX document?
From my understanding, a LaTeX document's layout and geometry are defined at the start of the document, and it is incredibly hard to change mid-document (even if you are willing to use a \clearpage).
This lack of fine control becomes really frustrating when dealing with margin notes, footnotes, and headers. For example:
* **Dynamic Margins:** Sometimes you want margin notes on specific pages, but on pages without notes, you want the main text to stretch out and reclaim that ugly, empty white space.
* **Footnote Spanning:** Sometimes you want footnotes to extend across the entire page width (underneath the margin notes), and other times you want them restricted strictly under the main text block.
* **Header/Margin Overlap:** You might want margin notes to extend up into the header space, or you might want the header itself to span across both the text body and the margin area.
* **Two-Sided Documents (twoside):** If you are writing a book, the margins alternate (inner vs. outer). Trying to dynamically change the layout or reclaim margin space mid-document without breaking the alternating margin logic seems almost impossible.
* **Binding Offsets:** When printing a physical book, any custom layout hacks or margin adjustments have to perfectly respect the binding offset so text doesn't get swallowed by the spine.
And let’s not even talk about how much more difficult getting this level of control becomes when you are typesetting RTL (Right-to-Left) documents, where the logical "inner/outer" and "left/right" get frustrating to work with.
So, are there any packages, frameworks or methods that offer actual fine control over the document's geometry? Or do I just need to rely on hacky workarounds and spend three hours fighting the layout, only to give up at the end and accept the way it currently looks?