TransWikia.com

Detecting the position in page. If end of page then write at the bottom, else write in situ

TeX - LaTeX Asked by magguu on June 29, 2021

I need to detect the position of the "cursor" in the page. I need a command which writes either "in situ" or at the bottom of the page (via vfill directive) depending on whether it is the last thing in that page.

The MWE is :

documentclass{article}

newcommand{midorlast}[1]{%
    % do vfill if nothing is left in the page to write.
    vfill
    framebox[textwidth]{#1}%
}

begin{document}

Wishes be horses.
%midorlast{Mid Page} % ideally this should be just below the last paragraph without any space produced.

Horses be wishes.
midorlast{End of page} % this shoould go at the bottom of the page


end{document}

Any idea … how do I achieve that?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP